aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/basetypes
diff options
context:
space:
mode:
authorGravatar Hoa V. Dinh <dinh.viet.hoa@gmail.com>2015-03-09 17:26:12 -0700
committerGravatar Hoa V. Dinh <dinh.viet.hoa@gmail.com>2015-03-09 17:26:12 -0700
commit1714bc64ddb5d9646eb21c6eb6999933f37ffbfe (patch)
treea5a165bafa3135e6154c2a89476125de5270f072 /src/core/basetypes
parent7d8979d9eca8e7c737fb66d9f18e2cb239700f74 (diff)
Handle gracefull comparision with NULL strings
Diffstat (limited to 'src/core/basetypes')
-rw-r--r--src/core/basetypes/MCString.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/basetypes/MCString.cpp b/src/core/basetypes/MCString.cpp
index 213d5e5f..02c93200 100644
--- a/src/core/basetypes/MCString.cpp
+++ b/src/core/basetypes/MCString.cpp
@@ -1194,6 +1194,9 @@ Data * String::encodedMIMEHeaderValueForSubject()
int String::compareWithCaseSensitive(String * otherString, bool caseSensitive)
{
+ if (otherString == NULL) {
+ return 1;
+ }
if ((length() == 0) && (otherString->length() == 0)) {
return 0;
}
@@ -1206,7 +1209,7 @@ int String::compareWithCaseSensitive(String * otherString, bool caseSensitive)
}
if (otherString->unicodeCharacters() == NULL) {
- return -1;
+ return 1;
}
#if DISABLE_ICU