isUpdateOf check field presence before comparison.
isUpdateOf is passed an "other" changeish that may be a Ref which does not have number and patchset fields which are compared against in Change's isUpdateOf method. Check that fields exist before comparisons are made. Change-Id: Ifb5a36dcb0377f496e6b0707ae27810b96f2c752 Reviewed-on: https://review.openstack.org/22159 Reviewed-by: Jeremy Stanley <fungi@yuggoth.org> Approved: Clark Boylan <clark.boylan@gmail.com> Reviewed-by: Clark Boylan <clark.boylan@gmail.com> Tested-by: Jenkins
This commit is contained in:
parent
dd26978d5d
commit
0197624ef7
|
@ -552,7 +552,8 @@ class Change(Changeish):
|
|||
return False
|
||||
|
||||
def isUpdateOf(self, other):
|
||||
if self.number == other.number and self.patchset > other.patchset:
|
||||
if ((hasattr(other, 'number') and self.number == other.number) and
|
||||
(hasattr(other, 'patchset') and self.patchset > other.patchset)):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
|
Loading…
Reference in New Issue