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