From b7b51025b94f77130f355a2c7b00a0fbcf533b2d Mon Sep 17 00:00:00 2001 From: "Carsey, Jaben" Date: Sat, 28 Apr 2018 06:32:17 +0800 Subject: BaseTools: check before accessing members in __eq__ minimize risk for exceptions. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu --- BaseTools/Source/Python/build/build.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'BaseTools/Source/Python/build') diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py index 56de2f6080..2a138a0d47 100644 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -377,7 +377,8 @@ class BuildUnit: # @param Other The other BuildUnit object compared to # def __eq__(self, Other): - return Other is not None and self.BuildObject == Other.BuildObject \ + return Other and self.BuildObject == Other.BuildObject \ + and Other.BuildObject \ and self.BuildObject.Arch == Other.BuildObject.Arch ## hash() method -- cgit v1.2.3