diff options
-rw-r--r-- | sway/config/output.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sway/config/output.c b/sway/config/output.c index e5ff240a..aab3f0bd 100644 --- a/sway/config/output.c +++ b/sway/config/output.c | |||
@@ -217,7 +217,10 @@ void store_output_config(struct output_config *oc) { | |||
217 | } | 217 | } |
218 | 218 | ||
219 | char id[128]; | 219 | char id[128]; |
220 | output_get_identifier(id, sizeof(id), output); | 220 | if (output) { |
221 | output_get_identifier(id, sizeof(id), output); | ||
222 | } | ||
223 | |||
221 | for (int i = 0; i < config->output_configs->length; i++) { | 224 | for (int i = 0; i < config->output_configs->length; i++) { |
222 | struct output_config *old = config->output_configs->items[i]; | 225 | struct output_config *old = config->output_configs->items[i]; |
223 | 226 | ||
@@ -240,7 +243,7 @@ void store_output_config(struct output_config *oc) { | |||
240 | 243 | ||
241 | // If the new config matches an output's name, and the old config | 244 | // If the new config matches an output's name, and the old config |
242 | // matches on that output's identifier, supersede it. | 245 | // matches on that output's identifier, supersede it. |
243 | if (strcmp(old->name, id) == 0 && | 246 | if (output && strcmp(old->name, id) == 0 && |
244 | strcmp(oc->name, output->wlr_output->name) == 0) { | 247 | strcmp(oc->name, output->wlr_output->name) == 0) { |
245 | supersede_output_config(old, oc); | 248 | supersede_output_config(old, oc); |
246 | } | 249 | } |