mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 08:46:37 -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():
|
||||
col.sched.randomizeCards()
|
||||
# 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()
|
||||
|
||||
# optimize and finish
|
||||
|
|
Loading…
Reference in a new issue