diff --git a/capirca/lib/port.py b/capirca/lib/port.py index 39e8384c..a7f51c38 100644 --- a/capirca/lib/port.py +++ b/capirca/lib/port.py @@ -79,7 +79,7 @@ def is_single_port(self): @property def start(self): # return the first port in the range as int - if '-' in self.port: + if self.port is not None and '-' in self.port: self._start = int(self.port.split('-')[0]) else: raise InvalidRange('%s is not a valid port range' % self.port) @@ -88,7 +88,7 @@ def start(self): @property def end(self): # return the last port in the range as int - if '-' in self.port: + if self.port is not None and '-' in self.port: self._end = int(self.port.split('-')[1]) else: raise InvalidRange('%s is not a valid port range' % self.port)