Merge pull request #181 from grote/kv-state-assertion

Add message to AssertionError to track down why it happens
This commit is contained in:
Torsten Grote 2020-12-28 08:23:02 -03:00 committed by GitHub
commit 08414800bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -67,7 +67,10 @@ internal class KVBackup(
} }
// initialize state // 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) this.state = KVBackupState(packageInfo)
// no need for backup when no data has changed // no need for backup when no data has changed