ICU-13177 Check if the other NullableValue object is null before trying to use its value.

X-SVN-Rev: 40594
This commit is contained in:
Jeff Genovy 2017-10-06 21:13:56 +00:00
parent 97901d274e
commit b1a2e40781

View 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() {