Don't save a NULL value in the upload field.

#2769 

The problem was that the delta value was NULL and the field cannot accept this. I also added a try and catch for a better error display. This would be helpful when the batch didn't display the SQL problem.