diff options
author | Carsey, Jaben <jaben.carsey@intel.com> | 2018-04-28 06:32:17 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2018-05-04 13:02:58 +0800 |
commit | b7b51025b94f77130f355a2c7b00a0fbcf533b2d (patch) | |
tree | 2e7668e4849443eebef26fd5d6bd513b1706b47a /BaseTools/Source/Python/AutoGen | |
parent | a7360838d7cc0b645b41d8b1713832ef4fbfdd64 (diff) | |
download | edk2-b7b51025b94f77130f355a2c7b00a0fbcf533b2d.tar.gz edk2-b7b51025b94f77130f355a2c7b00a0fbcf533b2d.tar.bz2 edk2-b7b51025b94f77130f355a2c7b00a0fbcf533b2d.zip |
BaseTools: check before accessing members in __eq__
minimize risk for exceptions.
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/AutoGen')
-rw-r--r-- | BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py b/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py index 602c90b3fe..1328dddf1a 100644 --- a/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py +++ b/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py @@ -259,10 +259,7 @@ class VAR_CHECK_PCD_VALID_OBJ(object): self.ValidData = False
def __eq__(self, validObj):
- if self.VarOffset == validObj.VarOffset:
- return True
- else:
- return False
+ return validObj and self.VarOffset == validObj.VarOffset
class VAR_CHECK_PCD_VALID_LIST(VAR_CHECK_PCD_VALID_OBJ):
def __init__(self, VarOffset, validlist, PcdDataType):
|