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 33
33
package org .scijava .io .handle ;
34
34
35
35
import java .io .IOException ;
36
- import java .util .Objects ;
37
36
38
37
import org .scijava .io .IOService ;
39
38
import org .scijava .io .location .Location ;
@@ -77,7 +76,7 @@ default Class<Location> getType() {
77
76
*/
78
77
default boolean exists (final Location location ) throws IOException {
79
78
try (DataHandle <Location > handle = create (location )) {
80
- return handle .exists ();
79
+ return handle == null ? false : handle .exists ();
81
80
}
82
81
}
83
82
@@ -89,8 +88,7 @@ default boolean exists(final Location location) throws IOException {
89
88
* @see ReadBufferDataHandle#ReadBufferDataHandle(DataHandle)
90
89
*/
91
90
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 );
94
92
}
95
93
96
94
/**
@@ -113,7 +111,6 @@ default DataHandle<Location> readBuffer(final Location location) {
113
111
* @see WriteBufferDataHandle#WriteBufferDataHandle(DataHandle)
114
112
*/
115
113
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 );
118
115
}
119
116
}
You can’t perform that action at this time.
0 commit comments