Create custom exception for lateinit
This commit is contained in:
@@ -8,7 +8,7 @@ class A : Intf {
|
||||
fun getMyStr(): String {
|
||||
try {
|
||||
val a = str
|
||||
} catch (e: NullPointerException) {
|
||||
} catch (e: RuntimeException) {
|
||||
return "OK"
|
||||
}
|
||||
return "FAIL"
|
||||
|
||||
Reference in New Issue
Block a user