0
0
mirror of https://github.com/ankidroid/Anki-Android.git synced 2024-09-20 03:52:15 +02:00

Fix crash on boot if you have dyn decks

This commit is contained in:
Houssam Salem 2017-01-05 10:58:19 +11:00 committed by Tim Rae
parent 5d15fd17b7
commit ba00078d0b

View File

@ -7,6 +7,7 @@ import android.content.Intent;
import com.ichi2.anki.CollectionHelper;
import com.ichi2.anki.receiver.ReminderReceiver;
import com.ichi2.libanki.Collection;
import org.json.JSONException;
import org.json.JSONObject;
@ -24,9 +25,12 @@ public class BootService extends IntentService {
try {
for (JSONObject deck : CollectionHelper.getInstance().getCol(this).getDecks().all()) {
Collection col = CollectionHelper.getInstance().getCol(this);
if (col.getDecks().isDyn(deck.getLong("id"))) {
continue;
}
final long deckConfigurationId = deck.getLong("conf");
final JSONObject deckConfiguration = CollectionHelper.getInstance().getCol(this).getDecks()
.getConf(deckConfigurationId);
final JSONObject deckConfiguration = col.getDecks().getConf(deckConfigurationId);
if (deckConfiguration.has("reminder")) {
final JSONObject reminder = deckConfiguration.getJSONObject("reminder");