diff --git a/src/main/java/org/hyperskill/hstest/stage/SpringTest.java b/src/main/java/org/hyperskill/hstest/stage/SpringTest.java index 74bdb011..868dae32 100644 --- a/src/main/java/org/hyperskill/hstest/stage/SpringTest.java +++ b/src/main/java/org/hyperskill/hstest/stage/SpringTest.java @@ -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; } @@ -189,7 +189,8 @@ public static void startSpring() throws Exception { } else { List> allClassesFromPackage = ReflectionUtils.getAllClassesFromPackage(""); allClassesFromPackage.forEach(it -> { - if (it.getCanonicalName().endsWith("Kt") + if (it.getCanonicalName() != null + && it.getCanonicalName().endsWith("Kt") && ReflectionUtils.hasMainMethod(it) && !springRunning) { try {