From 8be318d749a76bf2295ea60819dce32fe760088c Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sun, 23 Oct 2011 06:08:57 +0900 Subject: [PATCH] when removing a group should ensure there's an active one left --- anki/groups.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/anki/groups.py b/anki/groups.py index a4ac9af39..0dc4e0815 100644 --- a/anki/groups.py +++ b/anki/groups.py @@ -146,6 +146,9 @@ class GroupManager(object): # delete the group and add a grave del self.groups[str(gid)] self.deck._logRem([gid], REM_GROUP) + # ensure we have an active group + if gid in self.active(): + self.select(int(self.groups.keys()[0])) self.save() def allNames(self):