Skip to content

[vm-image-vault] Check for empty json before parse#4726

Merged
xmkg merged 1 commit into
mainfrom
bugfix/image-vault-check-empty-json
Mar 11, 2026
Merged

[vm-image-vault] Check for empty json before parse#4726
xmkg merged 1 commit into
mainfrom
bugfix/image-vault-check-empty-json

Conversation

@xmkg
Copy link
Copy Markdown
Member

@xmkg xmkg commented Mar 11, 2026

boost::json::parse throws an exception if the input is empty so guard against that.

boost::json::parse throws an exception if the input is empty so guard
against that.

Signed-off-by: Mustafa Kemal Gilor <mustafa.gilor@canonical.com>
@xmkg xmkg requested review from a team and jimporter and removed request for a team March 11, 2026 19:47
Copy link
Copy Markdown
Contributor

@jimporter jimporter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! I think this is the obvious way to handle empty files, while still being noisy about invalid JSON.

@xmkg xmkg enabled auto-merge March 11, 2026 20:01
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.67%. Comparing base (aee950a) to head (6418d5c).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4726   +/-   ##
=======================================
  Coverage   87.67%   87.67%           
=======================================
  Files         256      256           
  Lines       14113    14113           
=======================================
  Hits        12372    12372           
  Misses       1741     1741           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@xmkg xmkg added this pull request to the merge queue Mar 11, 2026
Merged via the queue into main with commit 8ea15f5 Mar 11, 2026
23 checks passed
@xmkg xmkg deleted the bugfix/image-vault-check-empty-json branch March 11, 2026 20:50
deepakshirkem pushed a commit to deepakshirkem/multipass that referenced this pull request Apr 26, 2026
boost::json::parse throws an exception if the input is empty so guard
against that.
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