Skip to content

Fix Json-CRITICAL assertions when parsing empty JSON data - #2647

Draft
irakligorgadze wants to merge 1 commit into
alainm23:mainfrom
irakligorgadze:fix/json-critical-empty-data
Draft

Fix Json-CRITICAL assertions when parsing empty JSON data#2647
irakligorgadze wants to merge 1 commit into
alainm23:mainfrom
irakligorgadze:fix/json-critical-empty-data

Conversation

@irakligorgadze

Copy link
Copy Markdown

JsonUtils.get_object() and Source's from_json constructors called parser.get_root().get_object() without checking if get_root() returned a valid node. Empty string input parses without error but yields no root node, triggering GLib CRITICAL assertions on every fresh install before any account/backup data exists.

Tested on Arch (Omarchy), built from main. Reproduced with a fresh
rm -rf ~/.local/share/io.github.alainm23.planify ~/.config/io.github.alainm23.planify,
confirmed the CRITICAL lines are gone after this fix.

JsonUtils.get_object() and Source's from_json constructors called
parser.get_root().get_object() without checking if get_root() returned
a valid node. Empty string input parses without error but yields no
root node, triggering GLib CRITICAL assertions on every fresh install
before any account/backup data exists.
Comment thread core/Objects/Source.vala
}
var object = root.get_object ();
if (object.has_member ("access_token")) {
access_token = object.get_string_member ("access_token");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why do you remove this ?

@byquanton
byquanton marked this pull request as draft August 27, 2026 16:01
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