1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

kcc: Don't check schedule if None

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12286

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>

Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Fri Sep 23 06:52:28 CEST 2016 on sn-devel-144
This commit is contained in:
Garming Sam 2016-09-22 15:28:57 +12:00 committed by Douglas Bagnall
parent bff3e5efba
commit 60e4bd381a

View File

@ -1214,11 +1214,19 @@ class NTDSConnection(object):
:param shed: schedule to compare to
"""
if self.schedule is not None:
if sched is None:
return False
elif sched is None:
return True
# There are 4 cases, where either self.schedule or sched can be None
#
# | self. is None | self. is not None
# --------------+-----------------+--------------------
# sched is None | True | False
# --------------+-----------------+--------------------
# sched is not None | False | do calculations
if self.schedule is None:
return sched is None
if sched is None:
return False
if ((self.schedule.size != sched.size or
self.schedule.bandwidth != sched.bandwidth or