Return None instead of crashing on undefined integer config items
authorKarl Hasselström <kha@treskal.com>
Mon, 12 Jan 2009 20:04:10 +0000 (21:04 +0100)
committerKarl Hasselström <kha@treskal.com>
Mon, 12 Jan 2009 20:04:10 +0000 (21:04 +0100)
Signed-off-by: Karl Hasselström <kha@treskal.com>
stgit/config.py

index 8934445..5b47580 100644 (file)
@@ -65,7 +65,9 @@ class GitConfig:
 
     def getint(self, name):
         value = self.get(name)
-        if value.isdigit():
+        if value == None:
+            return None
+        elif value.isdigit():
             return int(value)
         else:
             raise GitConfigException, 'Value for "%s" is not an integer: "%s"' % (name, value)