From b1b43428cc85774679c3115c6e5ff3aba4c0003a Mon Sep 17 00:00:00 2001 From: pavl_g Date: Wed, 7 Aug 2024 17:16:41 -0400 Subject: [PATCH] FileLocator#classPathRoutine(): assertion against null pointers --- .../java/electrostatic4j/snaploader/filesystem/FileLocator.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/snaploader/src/main/java/electrostatic4j/snaploader/filesystem/FileLocator.java b/snaploader/src/main/java/electrostatic4j/snaploader/filesystem/FileLocator.java index 810ca8b..c93b3bc 100644 --- a/snaploader/src/main/java/electrostatic4j/snaploader/filesystem/FileLocator.java +++ b/snaploader/src/main/java/electrostatic4j/snaploader/filesystem/FileLocator.java @@ -162,6 +162,8 @@ protected void classPathRoutine() { // getClassLoader() is invoked on them, it will return "null" pointer // indicating the invalidity of active loaders this.fileInputStream = getClass().getClassLoader().getResourceAsStream(filePath); + assert (this.fileInputStream != null): + "Classpath Routine failed: the file is not in the classpath!"; } /**