Skip to content

Commit

Permalink
Fixes #10: Check if attribute exists in property before accessing it
Browse files Browse the repository at this point in the history
  • Loading branch information
btorresgil committed Apr 12, 2016
1 parent 17cfa7e commit d366d59
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pandevice/ha.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@ def port(self):

@port.setter
def port(self, value):
if value != self._port:
self.old_port = self._port
self._port = value
if hasattr(self, "_port"):
if value != self._port:
self.old_port = self._port
self._port = value

@classmethod
def variables(cls):
Expand Down

0 comments on commit d366d59

Please sign in to comment.