Catch AttributeErrors in license retrieval
thorge opened this issue · comments
The following code segment may also result in an AttributeError
:
Lines 95 to 96 in 8ddc2e8
If, for some reason, the license object returned by model.Package.get_license_register()[license_id]
does not have an isopen
attribute or method, trying to call isopen()
would result in an AttributeError
, as well if model.Package.get_license_register()[license_id]
evaluates to None
. Currently, only KeyErrors
are being caught.
It is advisable to include AttributeError
in the except handle of the try block:
except (KeyError, AttributeError):
package[u'isopen'] = False
@amercader @thorge , I am interested to work on this issue. I will submit a PR.