Add message to AssertionError to track down why it happens

This commit is contained in:
Torsten Grote 2020-12-18 08:45:18 -03:00
parent 4906a00786
commit b7aedda90c
No known key found for this signature in database
GPG key ID: 3E5F77D92CF891FF

View file

@ -67,7 +67,10 @@ internal class KVBackup(
}
// initialize state
if (this.state != null) throw AssertionError()
val state = this.state
if (state != null) {
throw AssertionError("Have state for ${state.packageInfo.packageName}")
}
this.state = KVBackupState(packageInfo)
// no need for backup when no data has changed