Add a null image check

This commit is contained in:
Kovid Goyal 2016-05-06 11:06:31 +05:30
parent 072239c3eb
commit 56cffd7283

View File

@ -8,6 +8,7 @@
%ModuleCode
#include <imageops.h>
#define IMAGEOPS_PREFIX \
if (a0->isNull()) { PyErr_SetString(PyExc_ValueError, "Cannot operate on null QImage"); return NULL; } \
try {
#define IMAGEOPS_SUFFIX \
} catch (std::out_of_range &exc) { PyErr_SetString(PyExc_ValueError, exc.what()); return NULL; \