fixed undefined variable

Fixed an error in pre uploaded where the error field was not defined if
there was no error.