Skip to content

Conversation

@jdk-21
Copy link
Contributor

@jdk-21 jdk-21 commented Nov 10, 2025

I noticed that sometimes but infrequently the KeywordBlocker crashes because of a NullPointerException. I don't know what exactly was causing the issue, but this fix seems to work.

I just added some null checks and I had no crashes since.

This should fix:

@nethical6
Copy link
Owner

I initially thought Kotlin's .toString() method would always safely convert null values into the string "null". However, I've just found out that this safety guarantee disappears when you're dealing with Java Platform Types. In those scenarios, Kotlin defers to Java's rules, which results in a NullPointerException when a null reference is encountered.

Thanks a lot for helping!!

It does feel like all those issues are indeed solved.

@nethical6 nethical6 merged commit 78b7620 into nethical6:kt-rewrite Nov 10, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants