summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2013-05-01 08:47:49 -0300
committerdrebs <drebs@leap.se>2013-05-01 08:47:49 -0300
commit67a998e19d43e8b7cc143373d1a95b97400776b4 (patch)
tree9c9ad8fb259cf034cc76506c82dfff5bcf318b78 /src
parent6e264f345d6883ce0fcdb7d84ef5587ce221a7eb (diff)
Soledad close method checks if db exists.
Diffstat (limited to 'src')
-rw-r--r--src/leap/soledad/__init__.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/leap/soledad/__init__.py b/src/leap/soledad/__init__.py
index 7ffb6837..791f8331 100644
--- a/src/leap/soledad/__init__.py
+++ b/src/leap/soledad/__init__.py
@@ -290,7 +290,10 @@ class Soledad(object):
"""
Close underlying U1DB database.
"""
- self._db.close()
+ if hasattr(self, '_db') and isinstance(
+ self._db,
+ sqlcipher.SQLCipherDatabase):
+ self._db.close()
def __del__(self):
"""