mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
don't fail when upgrading an empty deck
This commit is contained in:
parent
39f3c84661
commit
592078545e
1 changed files with 2 additions and 1 deletions
|
@ -609,7 +609,8 @@ update cards set due = cast(
|
||||||
if col.models.randomNew():
|
if col.models.randomNew():
|
||||||
col.sched.randomizeCards()
|
col.sched.randomizeCards()
|
||||||
# update insertion id
|
# update insertion id
|
||||||
col.conf['nextPos'] = col.db.scalar("select max(id) from notes")+1
|
col.conf['nextPos'] = (
|
||||||
|
col.db.scalar("select max(id) from notes") or 0)+1
|
||||||
col.save()
|
col.save()
|
||||||
|
|
||||||
# optimize and finish
|
# optimize and finish
|
||||||
|
|
Loading…
Reference in a new issue