aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-07-16 11:55:53 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-07-16 11:55:53 +1000
commit64e3bc3ab09c0cc66b1675d39e4a9e872cbb46fd (patch)
tree9cd2cb8e44fd09664cc34bedcdd6bf12c6ac4b1a
parenta211daf9e6667102f282a3507d84090cb54c71fe (diff)
downloadsway-64e3bc3ab09c0cc66b1675d39e4a9e872cbb46fd.tar.xz
Fix crash in ipc_json_describe_view
I didn't expect a function called ipc_json_describe_view to be passed a container which wasn't a view :\
-rw-r--r--sway/ipc-json.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sway/ipc-json.c b/sway/ipc-json.c
index f9182291..f8de51ed 100644
--- a/sway/ipc-json.c
+++ b/sway/ipc-json.c
@@ -198,8 +198,10 @@ static void ipc_json_describe_view(struct sway_container *c, json_object *object
json_object_new_string(ipc_json_layout_description(c->layout)));
}
- json_object_object_add(object, "urgent",
- json_object_new_boolean(view_is_urgent(c->sway_view)));
+ if (c->type == C_VIEW) {
+ json_object_object_add(object, "urgent",
+ json_object_new_boolean(view_is_urgent(c->sway_view)));
+ }
}
static void focus_inactive_children_iterator(struct sway_container *c, void *data) {