Browse Source

Merge branch 'ticket/41'

closes #41
tickets/41/41/2
rarified 3 years ago
parent
commit
94fab5996f
  1. 5
      Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.cpp

5
Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.cpp

@ -587,16 +587,17 @@ std::wstring pyGUIControlListBox::GetElementW( UInt16 idx )
{ {
// if its a text element type then it should be safe to cast it to a pfGUIListText // if its a text element type then it should be safe to cast it to a pfGUIListText
pfGUIListText* letext = (pfGUIListText*)le; pfGUIListText* letext = (pfGUIListText*)le;
return letext->GetText(); return (letext->GetText() != nullptr) ? letext->GetText() : L"";
} }
else if ( le->GetType() == pfGUIListElement::kTreeRoot ) else if ( le->GetType() == pfGUIListElement::kTreeRoot )
{ {
pfGUIListTreeRoot* elroot = (pfGUIListTreeRoot*)le; pfGUIListTreeRoot* elroot = (pfGUIListTreeRoot*)le;
return elroot->GetTitle(); return (elroot->GetTitle() != nullptr) ? elroot->GetTitle() : L"";
} }
} }
} }
} }
return L""; return L"";
} }

Loading…
Cancel
Save