Skip to content

Commit

Permalink
Fix #22: crash if exitting the ConnectionDialog without selecting a s…
Browse files Browse the repository at this point in the history
…erver
  • Loading branch information
vincent-lg committed Oct 16, 2016
1 parent b52f281 commit 457c601
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
15 changes: 8 additions & 7 deletions src/cocomud.py
Expand Up @@ -49,10 +49,11 @@
# Create the client and ClientWindow
window = ClientWindow(engine)
world = window.world
hostname = window.panel.world.hostname
port = window.panel.world.port
client = engine.open(hostname, port, world)
client.link_window(window)
world.load()
client.start()
app.MainLoop()
if world is not None:
hostname = window.panel.world.hostname
port = window.panel.world.port
client = engine.open(hostname, port, world)
client.link_window(window)
world.load()
client.start()
app.MainLoop()
5 changes: 5 additions & 0 deletions src/ui/window.py
Expand Up @@ -48,6 +48,7 @@ class ClientWindow(DummyUpdater):

def __init__(self, engine, world=None):
super(ClientWindow, self).__init__(None)
self.panel = None
self.engine = engine
self.focus = True
self.interrupt = False
Expand Down Expand Up @@ -120,6 +121,10 @@ def InitUI(self, world=None):
dialog.ShowModal()
world = self.engine.default_world

if world is None:
self.Destroy()
return

self.panel = MUDPanel(self, self.engine, world)
self.SetTitle("{} [CocoMUD]".format(world.name))
self.Maximize()
Expand Down
2 changes: 1 addition & 1 deletion src/version.py
@@ -1 +1 @@
BUILD = 16
BUILD = 17

0 comments on commit 457c601

Please sign in to comment.