fixed exception when launching discovery dialog without network
authorEdouard Tisserant
Mon, 21 May 2012 16:40:57 +0200
changeset 740 cee825fbe9b3
parent 739 90dcb47a99ed
child 741 382b2c848dac
fixed exception when launching discovery dialog without network
ProjectController.py
--- a/ProjectController.py	Mon May 21 11:00:57 2012 +0200
+++ b/ProjectController.py	Mon May 21 16:40:57 2012 +0200
@@ -1257,11 +1257,14 @@
 
         # if uri is empty launch discovery dialog
         if uri == "":
-            # Launch Service Discovery dialog
-            dialog = DiscoveryDialog(self.AppFrame)
-            answer = dialog.ShowModal()
-            uri = dialog.GetURI()
-            dialog.Destroy()
+            try:
+                # Launch Service Discovery dialog
+                dialog = DiscoveryDialog(self.AppFrame)
+                answer = dialog.ShowModal()
+                uri = dialog.GetURI()
+                dialog.Destroy()
+            except:
+                uri = None
             
             # Nothing choosed or cancel button
             if uri is None or answer == wx.ID_CANCEL: