comparison main.c @ 576:414d11df07ce

Gracefully handle error situations when the main UI has not yet been initialized properly.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 30 Dec 2012 08:12:38 +0200
parents 699147b1bbbc
children 06675b69ca6c
comparison
equal deleted inserted replaced
575:cc1c68737227 576:414d11df07ce
257 { 257 {
258 char tmpStr[128]; 258 char tmpStr[128];
259 nn_window_t *tmpwin = (win != NULL) ? win : nnwin_main_window(); 259 nn_window_t *tmpwin = (win != NULL) ? win : nnwin_main_window();
260 260
261 // Only the main window 261 // Only the main window
262 if (win == NULL && (flags & LOG_RECURSIVE) == 0) 262 if (win == NULL && tmpwin != NULL && (flags & LOG_RECURSIVE) == 0)
263 { 263 {
264 time_t currTime = time(NULL); 264 time_t currTime = time(NULL);
265 struct tm *currTm, *prevTm; 265 struct tm *currTm, *prevTm;
266 266
267 if ((currTm = localtime(&currTime)) != NULL && 267 if ((currTm = localtime(&currTime)) != NULL &&