diff --git a/sway/config/output.c b/sway/config/output.c index 6c716ccb..a30d7954 100644 --- a/sway/config/output.c +++ b/sway/config/output.c @@ -222,7 +222,9 @@ static bool set_mode(struct wlr_output *output, int width, int height, best = mode; break; } - best = mode->refresh > best->refresh ? mode : best; + if (best == NULL || mode->refresh > best->refresh) { + best = mode; + } } } if (!best) {