diff options
| author | ghost <andreas.monzner@multimedia-labs.de> | 2010-06-04 14:50:01 +0200 |
|---|---|---|
| committer | ghost <andreas.monzner@multimedia-labs.de> | 2010-06-04 14:53:04 +0200 |
| commit | 3b29e9279367292962046494cf0da1b24827c269 (patch) | |
| tree | 247407aa362b675b4f7cc33dd9488a7301eb8cf8 | |
| parent | af7b17db9f8f86fc6a2a63464030efb20fab7820 (diff) | |
| download | enigma2-3b29e9279367292962046494cf0da1b24827c269.tar.gz enigma2-3b29e9279367292962046494cf0da1b24827c269.zip | |
lib/gui/elistboxcontent.cpp: dont crash on non selectable entries
| -rw-r--r-- | lib/gui/elistboxcontent.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/gui/elistboxcontent.cpp b/lib/gui/elistboxcontent.cpp index a65df2e2..1d0323cf 100644 --- a/lib/gui/elistboxcontent.cpp +++ b/lib/gui/elistboxcontent.cpp @@ -343,7 +343,6 @@ void eListboxPythonConfigContent::paint(gPainter &painter, eWindowStyle &style, if (PyTuple_Check(item)) { /* handle left part. get item from tuple, convert to string, display. */ - text = PyTuple_GET_ITEM(item, 0); text = PyObject_Str(text); /* creates a new object - old object was borrowed! */ const char *string = (text && PyString_Check(text)) ? PyString_AsString(text) : "<not-a-string>"; @@ -357,7 +356,9 @@ void eListboxPythonConfigContent::paint(gPainter &painter, eWindowStyle &style, int value_alignment_left = !*string; /* now, handle the value. get 2nd part from tuple*/ - value = PyTuple_GET_ITEM(item, 1); + if (PyTuple_Size(item) >= 2) // when no 2nd entry is in tuple this is a non selectable entry without config part + value = PyTuple_GET_ITEM(item, 1); + if (value) { ePyObject args = PyTuple_New(1); @@ -468,7 +469,7 @@ void eListboxPythonConfigContent::paint(gPainter &painter, eWindowStyle &style, } } /* type is borrowed */ - } else + } else if (value) eWarning("eListboxPythonConfigContent: second value of tuple is not a tuple."); if (value) Py_DECREF(value); |
