]> granicus.if.org Git - icu/commitdiff
ICU-13177 Check if the other NullableValue object is null before trying to use its...
authorJeff Genovy <29107334+jefgen@users.noreply.github.com>
Fri, 6 Oct 2017 21:13:56 +0000 (21:13 +0000)
committerJeff Genovy <29107334+jefgen@users.noreply.github.com>
Fri, 6 Oct 2017 21:13:56 +0000 (21:13 +0000)
X-SVN-Rev: 40594

icu4c/source/i18n/number_types.h

index ff863bb82f597303e63646e98d42e821f647a972..398c8ea60b35eba6555dab2137e9b4ea42958840 100644 (file)
@@ -260,7 +260,7 @@ class U_I18N_API NullableValue {
 
     bool operator==(const NullableValue &other) const {
         // "fValue == other.fValue" returns UBool, not bool (causes compiler warnings)
-        return fNull ? other.fNull : static_cast<bool>(fValue == other.fValue);
+        return fNull ? other.fNull : (other.fNull ? false : static_cast<bool>(fValue == other.fValue));
     }
 
     void nullify() {