Commit 59231e04 authored by Marek Beleščiak's avatar Marek Beleščiak Committed by Nate Graham
Browse files

KCM: fix crash when editing disabled display output's refresh rate

When display output was disabled, Output::currentMode() returned
a null pointer and used it shortly afterwards.

BUG: 450265
FIXED-IN: 5.24.2


(cherry picked from commit d6cc5433)
parent 3dd8f6c8
Pipeline #140634 passed with stage
in 3 minutes and 41 seconds
......@@ -426,7 +426,7 @@ bool OutputModel::setRefreshRate(int outputIndex, int refIndex)
{
const Output &output = m_outputs[outputIndex];
const auto rates = refreshRates(output.ptr);
if (refIndex < 0 || refIndex >= rates.size()) {
if (refIndex < 0 || refIndex >= rates.size() || !output.ptr->isEnabled()) {
return false;
}
const float refreshRate = rates[refIndex];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment