chiark / gitweb /
Fixed bug which happens if you slice without ever touching the start/end code.
authordaid <daid303@gmail.com>
Tue, 15 May 2012 07:34:45 +0000 (09:34 +0200)
committerdaid <daid303@gmail.com>
Tue, 15 May 2012 07:34:45 +0000 (09:34 +0200)
Cura/util/profile.py

index fd4d1ed72d526e636bbe5d8f7d219aac264b97b2..c85f90211e3e7155da015a56eb2af81e85845e27 100644 (file)
@@ -190,11 +190,13 @@ def loadGlobalProfileFromString(options):
        options = zlib.decompress(options)\r
        (profileOpts, alt) = options.split('\f', 1)\r
        for option in profileOpts.split('\b'):\r
-               (key, value) = option.split('=', 1)\r
-               globalProfileParser.set('profile', key, value)\r
+               if len(option) > 0:\r
+                       (key, value) = option.split('=', 1)\r
+                       globalProfileParser.set('profile', key, value)\r
        for option in alt.split('\b'):\r
-               (key, value) = option.split('=', 1)\r
-               globalProfileParser.set('alterations', key, value)\r
+               if len(option) > 0:\r
+                       (key, value) = option.split('=', 1)\r
+                       globalProfileParser.set('alterations', key, value)\r
 \r
 def getGlobalProfileString():\r
        global globalProfileParser\r