Skip to content

Commit

Permalink
Merge pull request #140 from polischuks/HSPC-65
Browse files Browse the repository at this point in the history
Null check added when searching for class name with Kt twist
  • Loading branch information
inuur authored Mar 24, 2023
2 parents f2a1492 + dcf6895 commit c37a4bf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/org/hyperskill/hstest/stage/SpringTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public static void startSpring() throws Exception {
.stream().map(Class::getCanonicalName)
.collect(Collectors.toList());
for (String name : allNameOfClasses) {
if (name.endsWith("Kt")) {
if (name != null && name.endsWith("Kt")) {
isKotlin = true;
break;
}
Expand Down Expand Up @@ -189,7 +189,8 @@ public static void startSpring() throws Exception {
} else {
List<Class<?>> allClassesFromPackage = ReflectionUtils.getAllClassesFromPackage("");
allClassesFromPackage.forEach(it -> {
if (it.getCanonicalName().endsWith("Kt")
if (it.getCanonicalName() != null
&& it.getCanonicalName().endsWith("Kt")
&& ReflectionUtils.hasMainMethod(it)
&& !springRunning) {
try {
Expand Down

0 comments on commit c37a4bf

Please sign in to comment.