From: Jeff Genovy <29107334+jefgen@users.noreply.github.com> Date: Fri, 6 Oct 2017 21:13:56 +0000 (+0000) Subject: ICU-13177 Check if the other NullableValue object is null before trying to use its... X-Git-Tag: release-60-rc~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b1a2e40781fa97cd6f24e01baee2bb31b806bf88;p=icu ICU-13177 Check if the other NullableValue object is null before trying to use its value. X-SVN-Rev: 40594 --- diff --git a/icu4c/source/i18n/number_types.h b/icu4c/source/i18n/number_types.h index ff863bb82f5..398c8ea60b3 100644 --- a/icu4c/source/i18n/number_types.h +++ b/icu4c/source/i18n/number_types.h @@ -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(fValue == other.fValue); + return fNull ? other.fNull : (other.fNull ? false : static_cast(fValue == other.fValue)); } void nullify() {