Skip to content

[Fix] Allow commandList JSON to Avoid Crashing

Apollo Zhu requested to merge apollozhu/kdeconnect-ios:fix-for-gsconnect into master

Fixes crash caused by GSConnect implementation https://github.com/GSConnect/gnome-shell-extension-gsconnect/issues/1051

Justification: this "bug" has already been fixed by GSConnect, which now sends a String instead of JSON. However, this fix is to ensure that older version of GSConnect (which are quite common as they're version-freezes by Long-Term-Support distribution releases) don't cause crashes with KDE Connect iOS.

Test

Test case found in https://github.com/GSConnect/gnome-shell-extension-gsconnect/pull/1053

Check that a network package body like this always works:

{
    "commandList": "{\"command-uuid\":{\"name\": \"Test Command\",\"command\":\"ls\"}}"
}

Check that a network package body like this only works with this fix:

{
    "commandList": {
        "command-uuid": {
            "name": "Test Command",
            "command": "ls"
        }
    }
}
Edited by Lucas Wang

Merge request reports