mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-01 01:20:25 +00:00
Avoid exception using <textbox /> on .xml widget files
The exception was thrown using std::string(nullptr) constructor.
This commit is contained in:
parent
9dbbcbd7ef
commit
0b1ae09a63
@ -400,12 +400,13 @@ Widget* WidgetLoader::convertXmlElementToWidget(const TiXmlElement* elem, Widget
|
||||
widget = new Slider(min_value, max_value, min_value);
|
||||
}
|
||||
else if (elem_name == "textbox") {
|
||||
const char* text = (elem->GetText() ? elem->GetText(): "");
|
||||
bool wordwrap = bool_attr(elem, "wordwrap", false);
|
||||
|
||||
if (!widget)
|
||||
widget = new TextBox(elem->GetText(), 0);
|
||||
widget = new TextBox(text, 0);
|
||||
else
|
||||
widget->setText(elem->GetText());
|
||||
widget->setText(text);
|
||||
|
||||
if (wordwrap)
|
||||
widget->setAlign(widget->align() | WORDWRAP);
|
||||
|
Loading…
x
Reference in New Issue
Block a user