Skip to content

Commit 1d6c29c

Browse files
committed
Prevent NPE on failed bytecode lookup
Log a warning if ClassGraph is not able to load the bytecode of the requested class.
1 parent aaae641 commit 1d6c29c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/com/code_intelligence/jazzer/agent/RuntimeInstrumentor.kt

+4-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,10 @@ class RuntimeInstrumentor(
181181
.acceptClasses(className)
182182
.scan()
183183
.use {
184-
it.getClassInfo(className).resource.load()
184+
it.getClassInfo(className)?.resource?.load() ?: run {
185+
Log.warn("Failed to load bytecode of class $className")
186+
return null
187+
}
185188
}
186189
val (instrumentedBytecode, duration) = measureTimedValue {
187190
try {

0 commit comments

Comments
 (0)