output: correctly handle outputs without a test() impl

This fixes a crash when calling wlr_output_test() on a headless
output.

Closes: https://github.com/swaywm/sway/issues/6213
This commit is contained in:
Simon Ser 2021-04-21 08:32:18 +02:00
parent 8e375ae340
commit 6622cd3277

View file

@ -580,6 +580,9 @@ bool wlr_output_test(struct wlr_output *output) {
if (!output_basic_test(output)) {
return false;
}
if (!output->impl->test) {
return true;
}
return output->impl->test(output);
}