From 10ad732dbffc8dded85b12c84f2839838c85ee82 Mon Sep 17 00:00:00 2001 From: Michael Ow Date: Fri, 11 Jan 2008 22:02:07 +0000 Subject: [PATCH] ICU-6132 Make sure that operator == does not dereference unit if it is null. X-SVN-Rev: 23210 --- icu4c/source/i18n/measure.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/icu4c/source/i18n/measure.cpp b/icu4c/source/i18n/measure.cpp index 03e6a7cbab..361c1facb0 100644 --- a/icu4c/source/i18n/measure.cpp +++ b/icu4c/source/i18n/measure.cpp @@ -1,6 +1,6 @@ /* ********************************************************************** -* Copyright (c) 2004, International Business Machines +* Copyright (c) 2004-2008, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** * Author: Alan Liu @@ -49,8 +49,8 @@ Measure::~Measure() { UBool Measure::operator==(const UObject& other) const { const Measure* m = (const Measure*) &other; return getDynamicClassID() == other.getDynamicClassID() && - number == m->getNumber() && - *unit == m->getUnit(); + number == m->getNumber() && + (unit != NULL && *unit == m->getUnit()); } //----------------------------------------------------------------------