alexmojaki / s3-stream-upload

Manages streaming of data to AWS S3 without knowing the size beforehand and without keeping it all in memory or writing to disk.
MIT License
208 stars 62 forks source link

Calling abort before the upload has been initiated results in NPE #37

Closed kcalcagno closed 3 years ago

kcalcagno commented 3 years ago

If abort(Throwable) is called before the upload has been successfully initiated, the abort method results in a NullPointerException called from Utils.skipMiddle. This is because StringTransferManager's toString method doesn't check whether uploadId is null before calling Utils.skipMiddle. The NPE then hides the underlying exception which prompted us to call abort in the first place.