Skip to content

Commit

Permalink
fix(kotlin): update null safety in PythonAstBaseListener.kt archguard…
Browse files Browse the repository at this point in the history
…/archguard#155

Update the code to use safe call operator to handle potential null values in the listener. This prevents null pointer exceptions and enhances the robustness of the code.
  • Loading branch information
phodal committed Nov 13, 2024
1 parent 9889209 commit c71e01e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ open class PythonAstBaseListener : PythonParserBaseListener() {
if (defParaCtx.text == "self") return@mapNotNull null

val parameter = CodeProperty(
TypeValue = defParaCtx.named_parameter().name().text,
TypeType = defParaCtx.named_parameter().test()?.text ?: ""
TypeValue = defParaCtx.named_parameter()?.name()?.text ?: "",
TypeType = defParaCtx.named_parameter()?.test()?.text ?: ""
)

if (defParaCtx.ASSIGN() != null) {
Expand Down

0 comments on commit c71e01e

Please sign in to comment.