mirror of
https://github.com/beetbox/beets.git
synced 2025-12-27 11:02:43 +01:00
add a defensive assertion
This commit is contained in:
parent
810841ba5a
commit
99bbecf7f5
1 changed files with 1 additions and 0 deletions
|
|
@ -301,6 +301,7 @@ class Model(object):
|
|||
"""
|
||||
self._check_db()
|
||||
stored_obj = self._db._get(type(self), self.id)
|
||||
assert stored_obj is not None, "object {0} not in DB".format(self.id)
|
||||
self.update(dict(stored_obj))
|
||||
self.clear_dirty()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue