jets3t icon indicating copy to clipboard operation
jets3t copied to clipboard

StorageObject#toString throws for pre-upload objects

Open chrylis opened this issue 1 year ago • 0 comments

When creating a new object to pass to putObject, the object has no metadata for the date. However, calling toString() invokes getLastModifiedDate(), which invokes getDate(), which throws IllegalArgumentException (which should really be IllegalStateException) if no date is set. This means that trying to log an object pre-upload causes an exception.

Since toString() should never throw an exception, it should either omit lastModified or inspect it in a null-safe manner.

chrylis avatar Feb 27 '24 22:02 chrylis