summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Healy <jalopeura@users.noreply.github.com>2017-05-20 01:05:34 (GMT)
committerAugustin Cavalier <waddlesplash@gmail.com>2017-05-20 01:05:34 (GMT)
commite683838e86c1bbae7570ed398bae9a137e280b77 (patch)
tree403a0e594101c5f60510068bd31e5d5a9bf1d8f1
parent75fc19076c562715e67562150460931a52c7bc78 (diff)
BTextView: Fix archiving after setting and unsetting disallowed characters.hrev51174
If you disallow and then re-allow characters, so that the number of disallowed chars returns to zero, BTextView::Archive will fail with "Invalid Argument". Fixes #13520. Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
-rw-r--r--src/kits/interface/TextView.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/kits/interface/TextView.cpp b/src/kits/interface/TextView.cpp
index 7aee6a3..e824a54 100644
--- a/src/kits/interface/TextView.cpp
+++ b/src/kits/interface/TextView.cpp
@@ -434,7 +434,7 @@ BTextView::Archive(BMessage* data, bool deep) const
if (err == B_OK)
err = data->AddBool("_nedit", !fEditable);
- if (err == B_OK && fDisallowedChars != NULL) {
+ if (err == B_OK && fDisallowedChars != NULL && fDisallowedChars->CountItems() > 0) {
err = data->AddData("_dis_ch", B_RAW_TYPE, fDisallowedChars->Items(),
fDisallowedChars->CountItems() * sizeof(int32));
}