If you try to lookup an object too early, you might find that the tbl is still a dict; this protects such early lookups from crashing

svn: r20812
This commit is contained in:
Doug Blank 2012-12-21 18:22:52 +00:00
parent 199f81a832
commit 2078bcc17c

View File

@ -709,6 +709,7 @@ class DbBsddbRead(DbReadBase, Callback):
return self.get_from_handle(handle, Tag, self.tag_map)
def __get_obj_from_gramps_id(self, val, tbl, class_, prim_tbl):
if isinstance(tbl, dict): return None ## trying to get object too early
try:
data = tbl.get(str(val), txn=self.txn)
if data is not None: