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,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
|
||||
@ -50,7 +50,7 @@ UBool Measure::operator==(const UObject& other) const {
|
||||
const Measure* m = (const Measure*) &other;
|
||||
return getDynamicClassID() == other.getDynamicClassID() &&
|
||||
number == m->getNumber() &&
|
||||
*unit == m->getUnit();
|
||||
(unit != NULL && *unit == m->getUnit());
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user