Check index validity

This commit is contained in:
Arun Prakash Jana 2018-08-01 19:26:35 +05:30
parent 2ad2cbb02b
commit 745b6190e4
No known key found for this signature in database
GPG Key ID: A75979F35C080412

View File

@ -1383,6 +1383,12 @@ class BukuDb:
try:
if self.chatty:
self.cur.execute('SELECT COUNT(*) from bookmarks where id BETWEEN ? AND ?', (low, high))
count = self.cur.fetchone()
if (count[0] < 1):
print('Index %d-%d: 0 deleted' % (low, high))
return False
if self.print_rec(0, low, high, True) is True:
resp = input('Delete these bookmarks? (y/n): ')
if resp != 'y':