summaryrefslogtreecommitdiff
path: root/src/protocols/GammaControl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/protocols/GammaControl.cpp')
-rw-r--r--src/protocols/GammaControl.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/protocols/GammaControl.cpp b/src/protocols/GammaControl.cpp
index 077d6e2f..e794e543 100644
--- a/src/protocols/GammaControl.cpp
+++ b/src/protocols/GammaControl.cpp
@@ -46,6 +46,13 @@ CGammaControl::CGammaControl(SP<CZwlrGammaControlV1> resource_, wl_resource* out
resource->setOnDestroy([this](CZwlrGammaControlV1* gamma) { PROTO::gamma->destroyGammaControl(this); });
resource->setSetGamma([this](CZwlrGammaControlV1* gamma, int32_t fd) {
+ if (!pMonitor) {
+ LOGM(ERR, "setGamma for a dead monitor");
+ resource->sendFailed();
+ close(fd);
+ return;
+ }
+
LOGM(LOG, "setGamma for {}", pMonitor->szName);
int fdFlags = fcntl(fd, F_GETFL, 0);