mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-20 20:19:32 +00:00
ICU-6132 Make sure that operator == does not dereference unit if it is null.
X-SVN-Rev: 23210
This commit is contained in:
parent
3edc99506c
commit
10ad732dbf
1 changed files with 3 additions and 3 deletions
|
@ -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());
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
Loading…
Add table
Reference in a new issue