Fix null pointer exception in the log when creating the database