File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
src/main/java/org/scijava/io/handle Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change 3333package org .scijava .io .handle ;
3434
3535import java .io .IOException ;
36- import java .util .Objects ;
3736
3837import org .scijava .io .IOService ;
3938import org .scijava .io .location .Location ;
@@ -77,7 +76,7 @@ default Class<Location> getType() {
7776 */
7877 default boolean exists (final Location location ) throws IOException {
7978 try (DataHandle <Location > handle = create (location )) {
80- return handle .exists ();
79+ return handle == null ? false : handle .exists ();
8180 }
8281 }
8382
@@ -89,8 +88,7 @@ default boolean exists(final Location location) throws IOException {
8988 * @see ReadBufferDataHandle#ReadBufferDataHandle(DataHandle)
9089 */
9190 default DataHandle <Location > readBuffer (final DataHandle <Location > handle ) {
92- Objects .nonNull (handle );
93- return new ReadBufferDataHandle (handle );
91+ return handle == null ? null : new ReadBufferDataHandle (handle );
9492 }
9593
9694 /**
@@ -113,7 +111,6 @@ default DataHandle<Location> readBuffer(final Location location) {
113111 * @see WriteBufferDataHandle#WriteBufferDataHandle(DataHandle)
114112 */
115113 default DataHandle <Location > writeBuffer (final DataHandle <Location > handle ) {
116- Objects .nonNull (handle );
117- return new WriteBufferDataHandle (handle );
114+ return handle == null ? null : new WriteBufferDataHandle (handle );
118115 }
119116}
You can’t perform that action at this time.
0 commit comments