Merge pull request #3219 from RedSoxFan/swaymsg-object-success

swaymsg: parse success of single object
This commit is contained in:
emersion 2018-11-29 09:10:00 +01:00 committed by GitHub
commit fd37ded3a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -32,6 +32,9 @@ static bool success_object(json_object *result) {
// Iterate results array and return false if any of them failed
static bool success(json_object *r, bool fallback) {
if (!json_object_is_type(r, json_type_array)) {
if (json_object_is_type(r, json_type_object)) {
return success_object(r);
}
return fallback;
}