[PR #398] [MERGED] Fix minor nested json issue #544

Closed
opened 2026-01-29 21:11:12 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/SabreTools/BinaryObjectScanner/pull/398
Author: @HeroponRikiBestest
Created: 12/2/2025
Status: Merged
Merged: 12/2/2025
Merged by: @mnadareski

Base: masterHead: minor-json-fix


📝 Commits (1)

  • 0f17f05 Fix minor nested json issue

📊 Changes

1 file changed (+1 additions, -0 deletions)

View changed files

📝 ProtectionScan/Features/MainFeature.cs (+1 -0)

📄 Description

I had one minor oversight in my existing implementation- if you scan a top-level directory/archive with protection, and it's the only thing that winds up having protection, nested json output crashes since it's expected that

if (!dict.ContainsKey(path))
    dict[path] = new Dictionary<string, object>();

would have ran, but that code hasn't been reached yet.
This issue only really impacted cases where nested json isn't needed anyways, but I'd still rather not leave faulty code in this function, especially if it gets moved to serialization later.


🔄 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/SabreTools/BinaryObjectScanner/pull/398 **Author:** [@HeroponRikiBestest](https://github.com/HeroponRikiBestest) **Created:** 12/2/2025 **Status:** ✅ Merged **Merged:** 12/2/2025 **Merged by:** [@mnadareski](https://github.com/mnadareski) **Base:** `master` ← **Head:** `minor-json-fix` --- ### 📝 Commits (1) - [`0f17f05`](https://github.com/SabreTools/BinaryObjectScanner/commit/0f17f0510446db7c726366fcbdfe8e5d72a4189e) Fix minor nested json issue ### 📊 Changes **1 file changed** (+1 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `ProtectionScan/Features/MainFeature.cs` (+1 -0) </details> ### 📄 Description I had one minor oversight in my existing implementation- if you scan a top-level directory/archive with protection, and it's the only thing that winds up having protection, nested json output crashes since it's expected that ```cs if (!dict.ContainsKey(path)) dict[path] = new Dictionary<string, object>(); ``` would have ran, but that code hasn't been reached yet. This issue only really impacted cases where nested json isn't needed anyways, but I'd still rather not leave faulty code in this function, especially if it gets moved to serialization later. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 21:11:12 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SabreTools/BinaryObjectScanner#544