Skip to content

Commit

Permalink
Merge pull request #2288 from ajaravete/fix_classloader_null_exception
Browse files Browse the repository at this point in the history
add check if contextClassLoader is null #2287
  • Loading branch information
ptrthomas authored Mar 30, 2023
2 parents fed432f + 6acda99 commit 0bc5a80
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion karate-core/src/main/java/com/intuit/karate/Suite.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,12 @@ public Suite(Runner.Builder rb) {
outputHtmlReport = false;
outputCucumberJson = false;
outputJunitXml = false;
classLoader = Thread.currentThread().getContextClassLoader();
var contextClassLoader = Thread.currentThread().getContextClassLoader();
if (contextClassLoader != null) {
classLoader = Thread.currentThread().getContextClassLoader();
} else {
classLoader = getClass().getClassLoader();
}
clientFactory = rb.clientFactory == null ? HttpClientFactory.DEFAULT : rb.clientFactory;
startTime = -1;
env = rb.env;
Expand Down

0 comments on commit 0bc5a80

Please sign in to comment.