File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
src/main/java/org/cactoos/io Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -215,10 +215,25 @@ public ResourceOf(final Text res,
215215 @ Override
216216 @ SuppressWarnings ("PMD.CloseResource" )
217217 public InputStream stream () throws Exception {
218+ if (this .path == null ) {
219+ throw new IllegalArgumentException (
220+ "The \" path\" of the resource is NULL, which is not allowed"
221+ );
222+ }
223+ if (this .loader == null ) {
224+ throw new IllegalArgumentException (
225+ "The \" classloader\" is NULL, which is not allowed"
226+ );
227+ }
218228 InputStream input = this .loader .getResourceAsStream (
219229 this .path .asString ()
220230 );
221231 if (input == null ) {
232+ if (this .fallback == null ) {
233+ throw new IllegalArgumentException (
234+ "The \" fallback\" is NULL, which is not allowed"
235+ );
236+ }
222237 input = new IoCheckedFunc <>(this .fallback )
223238 .apply (this .path )
224239 .stream ();
You can’t perform that action at this time.
0 commit comments