BUGFIX : protect against double closing
authorjaviplx <javiplx@gmail.com>
Sun, 10 Oct 2010 11:58:37 +0000 (11:58 +0000)
committerjaviplx <javiplx@gmail.com>
Sun, 10 Oct 2010 11:58:37 +0000 (11:58 +0000)
git-svn-id: file:///svnroot/wifihood/trunk/wifiscanner@41 c51dfc6a-5949-4919-9c8e-f207a149c383

wifimap/db.py

index 42edfc3..f04558b 100644 (file)
@@ -41,8 +41,9 @@ class database :
             self.db.executescript( create_db )
 
     def close ( self ) :
-        self.db.close()
-        self.db = None
+        if self.db :
+            self.db.close()
+            self.db = None
 
     def is_open ( self ) :
         if not self.db :