pkl icon indicating copy to clipboard operation
pkl copied to clipboard

Fix NPE in VmTyped.hashCode when property is null

Open jurajmaj opened this issue 1 month ago • 2 comments

Fixes #1167

Null properties in VmTyped previously caused a NPE when accessed through hashCode(). This fix adds null checks so that containsKey and other map operations do not crash.

jurajmaj avatar Nov 15 '25 18:11 jurajmaj

Hi @HT154, this PR is related to the issue we discussed #1167. I just wanted to check if there’s any feedback. Thank you for your time!

jurajmaj avatar Nov 22 '25 20:11 jurajmaj

Hi @jurajmaj, thanks for the contribution! Most of the team is away until December, so it'll take us a little more time to review this fully. Thanks for your patience!

That said, my gut feeling here is that isn't quite the right way to resolve this. The cached property value being null here is a symptom of a Pkl stack overflow (circular data reference), so that should be the error communicated to the user. Interestingly, the exception's Pkl stack trace has already been rendered accordingly!

HT154 avatar Nov 23 '25 04:11 HT154