From 5b5bfef03596d95079c728f65f523570dd7b03aa Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Fri, 2 Feb 2018 10:05:37 +0100 Subject: check the error condition of mainwindow_create --- src/fe-text/mainwindows.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/fe-text/mainwindows.c b/src/fe-text/mainwindows.c index 5f24674f..0c77bcf1 100644 --- a/src/fe-text/mainwindows.c +++ b/src/fe-text/mainwindows.c @@ -1393,6 +1393,11 @@ static void _cmd_window_show_opt(const char *data, int right) } parent = mainwindow_create(right); + if (parent == NULL) { + printformat_window(active_win, MSGLEVEL_CLIENTERROR, TXT_WINDOW_TOO_SMALL); + return; + } + parent->active = window; gui_window_reparent(window, parent); -- cgit v1.2.3