From 4e28bce6d07b55c606d849114ced81da1739f612 Mon Sep 17 00:00:00 2001 From: Kenny Levinsen Date: Thu, 16 Nov 2023 14:17:54 +0100 Subject: [PATCH] config/output: Check if preferred mode is NULL --- sway/config/output.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sway/config/output.c b/sway/config/output.c index eefde22b..352bdf49 100644 --- a/sway/config/output.c +++ b/sway/config/output.c @@ -278,6 +278,10 @@ static void set_mode(struct wlr_output *output, struct wlr_output_state *pending best->width, best->height, best->refresh / 1000.f, output->name); } else { best = wlr_output_preferred_mode(output); + if (!best) { + sway_log(SWAY_ERROR, "No preferred mode for output %s", output->name); + return; + } sway_log(SWAY_INFO, "Configured mode (%dx%d@%.3fHz) not available, " "applying preferred mode (%dx%d@%.3fHz)", width, height, refresh_rate,