Added code to ensure logfile is not NoneType when deciding to create a pastebin of last 50 lines of logfile