Fix crash when logfile is none