# HG changeset patch # User Matti Hamalainen # Date 1356847958 -7200 # Node ID 414d11df07ceb1cc5b53ac592aaeeb8bdc082135 # Parent cc1c687372270682e6a0ffc057ca60429b48cfdc Gracefully handle error situations when the main UI has not yet been initialized properly. diff -r cc1c68737227 -r 414d11df07ce main.c --- a/main.c Thu Dec 13 15:50:54 2012 +0200 +++ b/main.c Sun Dec 30 08:12:38 2012 +0200 @@ -259,7 +259,7 @@ nn_window_t *tmpwin = (win != NULL) ? win : nnwin_main_window(); // Only the main window - if (win == NULL && (flags & LOG_RECURSIVE) == 0) + if (win == NULL && tmpwin != NULL && (flags & LOG_RECURSIVE) == 0) { time_t currTime = time(NULL); struct tm *currTm, *prevTm; diff -r cc1c68737227 -r 414d11df07ce ui.c --- a/ui.c Thu Dec 13 15:50:54 2012 +0200 +++ b/ui.c Sun Dec 30 08:12:38 2012 +0200 @@ -254,6 +254,9 @@ const char *s = fmt; int col = 0; + if (win == NULL) + return -16; + while (*s) { if (win->line == NULL)