Check for invalid signal or slot name.

Reviewer: Hugo Parente Lima <hugo.lima@openbossa.org>,
          Luciano Wolf <luciano.wolf@openbossa.org>
This commit is contained in:
Renato Filho 2010-06-22 18:08:25 -03:00
commit b1f7791a72
2 changed files with 8 additions and 2 deletions

View file

@ -82,11 +82,14 @@ using namespace PySide;
bool PySide::isSignal(const char* signal)
{
return signal[0] == PYSIDE_SIGNAL;
return (signal && signal[0] == PYSIDE_SIGNAL);
}
bool PySide::checkSignal(const char* signal)
{
if (!signal)
return false;
if (signal[0] != PYSIDE_SIGNAL) {
PyErr_SetString(PyExc_TypeError, "Use the function PySide.QtCore.SIGNAL on signals");
return false;