From b1a2e40781fa97cd6f24e01baee2bb31b806bf88 Mon Sep 17 00:00:00 2001 From: Jeff Genovy <29107334+jefgen@users.noreply.github.com> Date: Fri, 6 Oct 2017 21:13:56 +0000 Subject: [PATCH] ICU-13177 Check if the other NullableValue object is null before trying to use its value. X-SVN-Rev: 40594 --- icu4c/source/i18n/number_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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() { -- 2.40.0