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.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/apple/pkl/pull/1320
**Author:** [@jurajmaj](https://github.com/jurajmaj)
**Created:** 11/15/2025
**Status:** 🔄 Open
**Base:** `main` ← **Head:** `npe-in-hashcode`
---
### 📝 Commits (2)
- [`6ba027a`](https://github.com/apple/pkl/commit/6ba027aa5038507cbb403bd1db9c767a73078a7b) Fix NPE in VmTyped.hashCode when property is null
- [`7a0b32c`](https://github.com/apple/pkl/commit/7a0b32c7129c6a49b8351ab509d5267c871e9167) Use stackOverflowError for circular reference handling in hashCode
### 📊 Changes
**2 files changed** (+6 additions, -2 deletions)
<details>
<summary>View changed files</summary>
📝 `pkl-core/src/main/java/org/pkl/core/runtime/VmExceptionBuilder.java` (+5 -1)
📝 `pkl-core/src/main/java/org/pkl/core/runtime/VmTyped.java` (+1 -1)
</details>
### 📄 Description
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.
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/apple/pkl/pull/1320
Author: @jurajmaj
Created: 11/15/2025
Status: 🔄 Open
Base:
main← Head:npe-in-hashcode📝 Commits (2)
6ba027aFix NPE in VmTyped.hashCode when property is null7a0b32cUse stackOverflowError for circular reference handling in hashCode📊 Changes
2 files changed (+6 additions, -2 deletions)
View changed files
📝
pkl-core/src/main/java/org/pkl/core/runtime/VmExceptionBuilder.java(+5 -1)📝
pkl-core/src/main/java/org/pkl/core/runtime/VmTyped.java(+1 -1)📄 Description
Fixes #1167
Null properties in
VmTypedpreviously caused a NPE when accessed throughhashCode().This fix adds null checks so that
containsKeyand other map operations do not crash.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.