From 6572e18ded9435263f63459290175665ff690332 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Mon, 3 May 2021 13:37:03 +0300 Subject: App: Crash with --echo when shutting down --- src/app.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/app.c') diff --git a/src/app.c b/src/app.c index 3c1dd025..ef130770 100644 --- a/src/app.c +++ b/src/app.c @@ -1310,9 +1310,10 @@ void postCommand_Root(iRoot *d, const char *command) { ev.user.data2 = d; /* all events are root-specific */ SDL_PushEvent(&ev); if (app_.commandEcho) { + iWindow *win = get_Window(); printf("%s[command] {%d} %s\n", app_.isLoadingPrefs ? "[Prefs] " : "", - (d == NULL ? 0 : d == get_Window()->roots[0] ? 1 : 2), + (d == NULL || win == NULL ? 0 : d == win->roots[0] ? 1 : 2), command); fflush(stdout); } } -- cgit v1.2.3