X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=decoder.c;h=cef4f299aea927d76d64adbb8ba9dcc39a2bf927;hb=bd50ceb314e4607e596c98c534aafcfe142a73b6;hp=5239818faa33a8fb9b8f8e4cd55faf5cba69a774;hpb=4c180223a8ae12feb7bc3601e07e848fb9cdb493;p=libsigrokdecode.git diff --git a/decoder.c b/decoder.c index 5239818..cef4f29 100644 --- a/decoder.c +++ b/decoder.c @@ -869,7 +869,7 @@ err_out: /** * Return a protocol decoder's docstring. * - * @param dec The loaded protocol decoder. + * @param dec The loaded protocol decoder. Must not be NULL. * * @return A newly allocated buffer containing the protocol decoder's * documentation. The caller is responsible for free'ing the buffer. @@ -885,7 +885,7 @@ SRD_API char *srd_decoder_doc_get(const struct srd_decoder *dec) if (!srd_check_init()) return NULL; - if (!dec) + if (!dec || !dec->py_mod) return NULL; gstate = PyGILState_Ensure();