Fix accessing nullable location() method
This commit is contained in:
@@ -253,7 +253,7 @@ class KotlinFieldBreakpoint(
|
||||
}
|
||||
|
||||
fun matchesEvent(event: LocatableEvent): Boolean {
|
||||
val method = event.location().method()
|
||||
val method = event.location()?.method()
|
||||
// TODO check property type
|
||||
return method != null && method.name() in getMethodsName()
|
||||
}
|
||||
@@ -264,7 +264,7 @@ class KotlinFieldBreakpoint(
|
||||
}
|
||||
|
||||
override fun getEventMessage(event: LocatableEvent): String {
|
||||
val location = event.location()
|
||||
val location = event.location()!!
|
||||
val locationQName = location.declaringType().name() + "." + location.method().name()
|
||||
val locationFileName = try {
|
||||
location.sourceName()
|
||||
|
||||
@@ -169,7 +169,7 @@ fun suspendFunctionFirstLineLocation(location: Location): Int? {
|
||||
return null
|
||||
}
|
||||
|
||||
val lineNumber = location.method().location().lineNumber()
|
||||
val lineNumber = location.method().location()?.lineNumber()
|
||||
if (lineNumber == -1) {
|
||||
return null
|
||||
}
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ class KotlinSyntheticTypeComponentProvider: SyntheticTypeComponentProvider {
|
||||
try {
|
||||
if (typeComponent.isDelegateToDefaultInterfaceImpl()) return true
|
||||
|
||||
if (typeComponent.location().lineNumber() != 1) return false
|
||||
if (typeComponent.location()?.lineNumber() != 1) return false
|
||||
|
||||
if (typeComponent.allLineLocations().any { it.lineNumber() != 1 }) {
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user