Fix #5522: Clicking Player Name field results in crash

This commit is contained in:
Ted John 2017-06-01 17:38:57 +01:00
parent ab8e8952e0
commit bf16951341
2 changed files with 2 additions and 2 deletions

View File

@ -1080,7 +1080,7 @@ static void widget_text_box_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widg
gCurrentFontSpriteBase = FONT_SPRITE_BASE_MEDIUM;
gCurrentFontFlags = 0;
if (!active) {
if (!active || gTextInput == NULL) {
if (w->widgets[widgetIndex].text != 0) {
safe_strcpy(wrapped_string, w->widgets[widgetIndex].string, 512);

View File

@ -2513,7 +2513,7 @@ void window_start_textbox(rct_window *call_w, rct_widgetindex call_widget, rct_s
// from crashing the game.
gTextBoxInput[maxLength - 1] = '\0';
context_start_text_input(gTextBoxInput, maxLength);
gTextInput = context_start_text_input(gTextBoxInput, maxLength);
}
void window_cancel_textbox()