diff --git a/src/e_mod_edgar.c b/src/e_mod_edgar.c index 415ba09..6f016f8 100644 --- a/src/e_mod_edgar.c +++ b/src/e_mod_edgar.c @@ -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))