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):
def setServer(self, 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.server = server
if server is not None:
if server is not None and self.manager is not None:
self.manager.registerServer(self)
def getServer(self):
......@@ -60,11 +60,11 @@ class Node(object):
def setUUID(self, 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.uuid = uuid
if uuid is not None:
if uuid is not None and self.manager is not None:
self.manager.registerUUID(self)
def getUUID(self):
......@@ -146,3 +146,4 @@ class NodeManager(object):
def getNodeByUUID(self, 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