Check the existance of the opts dict before accessing it
This commit is contained in:
parent
ea66f6dbc2
commit
fd5637b089
|
@ -266,7 +266,8 @@ edgar_gadget_load(const char *name, const char *path)
|
|||
gadget->edjefile = NULL;
|
||||
|
||||
// read the gadget options dict
|
||||
if ((opts = PyObject_GetAttrString(mod, "__gadget_opts__")))
|
||||
if (PyObject_HasAttrString(mod, "__gadget_opts__") &&
|
||||
(opts = PyObject_GetAttrString(mod, "__gadget_opts__")))
|
||||
{
|
||||
attr = PyDict_GetItemString(opts, "popup_on_desktop");
|
||||
if (attr && PyObject_IsTrue(attr))
|
||||
|
|
Loading…
Reference in New Issue