mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-01-30 21:03:49 +02: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
|
:returns: Node instance
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
node = None
|
||||||
try:
|
try:
|
||||||
node = yield from self.close_node(node_id)
|
node = self.get_node(node_id)
|
||||||
|
yield from self.close_node(node_id)
|
||||||
finally:
|
finally:
|
||||||
node.project.emit("node.deleted", node)
|
if node:
|
||||||
yield from node.project.remove_node(node)
|
node.project.emit("node.deleted", node)
|
||||||
|
yield from node.project.remove_node(node)
|
||||||
if node.id in self._nodes:
|
if node.id in self._nodes:
|
||||||
del self._nodes[node.id]
|
del self._nodes[node.id]
|
||||||
return node
|
return node
|
||||||
|
Loading…
Reference in New Issue
Block a user