Skip to content

Commit 601120d

Browse files
committed
fix: handle null in shortFormat() method
1 parent 3952e74 commit 601120d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/main/kotlin/cc/unitmesh/devti/context/VariableContext.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ class VariableContext(
3333
}
3434
}
3535

36-
fun shortFormat(): String {
37-
return root.text
38-
}
36+
fun shortFormat(): String = root.text ?: ""
3937

4038
/**
4139
* Returns a formatted string representation of the method.

0 commit comments

Comments
 (0)