entry was selected. Return 0 in this case, not an invalid string address
(causing segfaults).
dialogs.cxx: don't set property if no list entry was chosen.
// Special case to handle lists, as getStringValue cannot be overridden
if(object->getType() & PUCLASS_LIST)
{
- node->setStringValue(((puList *) object)->getListStringValue());
+ const char *s = ((puList *) object)->getListStringValue();
+ if (s)
+ node->setStringValue(s);
}
else
{
char *
puList::getListStringValue ()
{
- return _contents[_list_box->getIntegerValue()];
+ int i = _list_box->getIntegerValue();
+ return i < 0 ? 0 : _contents[i];
}
int