Fixed nullPointerException on failed upload