fix a possible printf(NULL) when -debug is used