fix potential infinite loop for invalid multipart upload