Fix sway_log using non initialised output_config pointer

This fixes a crash where the `oc->name` would be accessed by sway_log()
even when `oc` was NULL.
This commit is contained in:
Paul Riou 2019-12-31 12:53:30 +00:00 committed by Simon Ser
parent ef2332f7a6
commit 2b5e75032b

View File

@ -334,7 +334,7 @@ bool apply_output_config(struct output_config *oc, struct sway_output *output) {
} }
if (!oc || oc->dpms_state != DPMS_OFF) { if (!oc || oc->dpms_state != DPMS_OFF) {
sway_log(SWAY_DEBUG, "Turning on output %s", oc->name); sway_log(SWAY_DEBUG, "Turning on output %s", wlr_output->name);
wlr_output_enable(wlr_output, true); wlr_output_enable(wlr_output, true);
if (oc && oc->width > 0 && oc->height > 0) { if (oc && oc->width > 0 && oc->height > 0) {