# HG changeset patch
# User Edouard Tisserant
# Date 1626771145 -7200
# Node ID d6612579f1d4d6e44516011e14cefeeb572d7775
# Parent  55e69df85fe162b94d45fbda99dfa48b95225f1e
Runtime: more robust loading of Wamp config, specially in case config file was corrupted.

diff -r 55e69df85fe1 -r d6612579f1d4 runtime/WampClient.py
--- a/runtime/WampClient.py	Tue Jul 20 09:43:35 2021 +0200
+++ b/runtime/WampClient.py	Tue Jul 20 10:52:25 2021 +0200
@@ -198,9 +198,15 @@
 def GetConfiguration():
     global lastKnownConfig
 
+    WampClientConf = None
+
     if os.path.exists(_WampConf):
-        WampClientConf = json.load(open(_WampConf))
-    else:
+        try: 
+            WampClientConf = json.load(open(_WampConf))
+        except ValueError:
+            pass
+
+    if WampClientConf is None:
         WampClientConf = defaultWampConfig.copy()
 
     for itemName in mandatoryConfigItems: