mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-13 20:08:55 +00:00
Fix UnboundLocalError: local variable 'node' referenced before assignment. Fixes #1256.
This commit is contained in:
parent
4143ee8178
commit
ed275e4ec5
@ -335,11 +335,14 @@ class BaseManager:
|
||||
:returns: Node instance
|
||||
"""
|
||||
|
||||
node = None
|
||||
try:
|
||||
node = yield from self.close_node(node_id)
|
||||
node = self.get_node(node_id)
|
||||
yield from self.close_node(node_id)
|
||||
finally:
|
||||
node.project.emit("node.deleted", node)
|
||||
yield from node.project.remove_node(node)
|
||||
if node:
|
||||
node.project.emit("node.deleted", node)
|
||||
yield from node.project.remove_node(node)
|
||||
if node.id in self._nodes:
|
||||
del self._nodes[node.id]
|
||||
return node
|
||||
|
Loading…
Reference in New Issue
Block a user