chiark / gitweb /
Fixed #82
authorDaid <daid303@gmail.com>
Sat, 28 Apr 2012 16:32:34 +0000 (18:32 +0200)
committerDaid <daid303@gmail.com>
Sat, 28 Apr 2012 16:32:34 +0000 (18:32 +0200)
Cura/util/profile.py

index 419724cbb9107e1e774cdef9393a639c6d8079f0..b7450a6c5b6f05656f5aa608991645e87f93de75 100644 (file)
@@ -177,10 +177,12 @@ def getGlobalProfileString():
        \r
        p = []\r
        alt = []\r
-       for key in globalProfileParser.options('profile'):\r
-               p.append(key + "=" + globalProfileParser.get('profile', key))\r
-       for key in globalProfileParser.options('alterations'):\r
-               alt.append(key + "=" + globalProfileParser.get('alterations', key))\r
+       if globalProfileParser.has_section('profile'):\r
+               for key in globalProfileParser.options('profile'):\r
+                       p.append(key + "=" + globalProfileParser.get('profile', key))\r
+       if globalProfileParser.has_section('alterations'):\r
+               for key in globalProfileParser.options('alterations'):\r
+                       alt.append(key + "=" + globalProfileParser.get('alterations', key))\r
        ret = '\b'.join(p) + '\f' + '\b'.join(alt)\r
        ret = base64.b64encode(zlib.compress(ret, 9))\r
        return ret\r