Commit 6fa4ebc3 authored by Aurel's avatar Aurel

check manager is not None before calling it


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@301 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent fd0506e7
...@@ -48,11 +48,11 @@ class Node(object): ...@@ -48,11 +48,11 @@ class Node(object):
def setServer(self, server): def setServer(self, server):
if self.server != server: if self.server != server:
if self.server is not None: if self.server is not None and self.manager is not None:
self.manager.unregisterServer(self) self.manager.unregisterServer(self)
self.server = server self.server = server
if server is not None: if server is not None and self.manager is not None:
self.manager.registerServer(self) self.manager.registerServer(self)
def getServer(self): def getServer(self):
...@@ -60,11 +60,11 @@ class Node(object): ...@@ -60,11 +60,11 @@ class Node(object):
def setUUID(self, uuid): def setUUID(self, uuid):
if self.uuid != uuid: if self.uuid != uuid:
if self.uuid is not None: if self.uuid is not None and self.manager is not None:
self.manager.unregisterUUID(self) self.manager.unregisterUUID(self)
self.uuid = uuid self.uuid = uuid
if uuid is not None: if uuid is not None and self.manager is not None:
self.manager.registerUUID(self) self.manager.registerUUID(self)
def getUUID(self): def getUUID(self):
...@@ -146,3 +146,4 @@ class NodeManager(object): ...@@ -146,3 +146,4 @@ class NodeManager(object):
def getNodeByUUID(self, uuid): def getNodeByUUID(self, uuid):
return self.uuid_dict.get(uuid) return self.uuid_dict.get(uuid)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment