Skip to content

Commit 82a38d3

Browse files
authored
Change unsafe access to jClass in updateGenericTypeInfo (#1526)
1 parent b9fc3da commit 82a38d3

File tree

1 file changed

+4
-1
lines changed
  • utbot-framework/src/main/kotlin/org/utbot/engine

1 file changed

+4
-1
lines changed

utbot-framework/src/main/kotlin/org/utbot/engine/Traverser.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,10 @@ class Traverser(
10351035
* Stores information about the generic types used in the parameters of the method under test.
10361036
*/
10371037
private fun updateGenericTypeInfo(identityRef: IdentityRef, value: ReferenceValue) {
1038-
val callable = methodUnderTest.executable
1038+
// If we don't have access to methodUnderTest's jClass, the engine should not fail
1039+
// We just won't update generic information for it
1040+
val callable = runCatching { methodUnderTest.executable }.getOrNull() ?: return
1041+
10391042
val type = if (identityRef is ThisRef) {
10401043
// TODO: for ThisRef both methods don't return parameterized type
10411044
if (methodUnderTest.isConstructor) {

0 commit comments

Comments
 (0)