Fix issue #12.

This commit is contained in:
Arun Prakash Jana 2016-05-19 20:24:50 +05:30
parent 31a46e041a
commit 61ab239351
No known key found for this signature in database
GPG Key ID: C0A712ED95043DCB

4
buku
View File

@ -638,10 +638,10 @@ def compactDB(conn, cur, index):
"""
cur.execute('SELECT MAX(id) from bookmarks')
if cur.rowcount < 1:
results = cur.fetchall()
if len(results) == 1 and results[0][0] is None: # Return if the last index was just deleted
return
results = cur.fetchall()
for row in results:
if row[0] > index:
cur.execute('SELECT id, URL, metadata, tags, desc FROM bookmarks WHERE id = ?', (row[0],))