Fix null pointer exception. Quit on upload