From 9f305872f515b63a49daeeedf5ebfe3af5bfd8da Mon Sep 17 00:00:00 2001 From: Sung-Jin Park Date: Wed, 19 Aug 2020 14:54:02 +0900 Subject: [PATCH] DSZone: add null check for waylandCompositor variable Change-Id: I7883a7d0054a0aaf756b48b0d073071a56c24e96 Signed-off-by: Sung-Jin Park --- src/DSZone/DSZone.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/DSZone/DSZone.cpp b/src/DSZone/DSZone.cpp index 0b0f043..e127faa 100644 --- a/src/DSZone/DSZone.cpp +++ b/src/DSZone/DSZone.cpp @@ -38,8 +38,11 @@ DSZone::DSZone() __wm(nullptr) { __waylandCompositor = DSWaylandCompositor::getInstance(); - __waylandCompositor->registerCallbackSurfaceCreated(this, std::bind(&DSZone::__onSurfaceCreated, this, std::placeholders::_1)); - __waylandCompositor->registerCallbackSurfaceDestroy(this, std::bind(&DSZone::__onSurfaceDestroy, this, std::placeholders::_1)); + if (__waylandCompositor) + { + __waylandCompositor->registerCallbackSurfaceCreated(this, std::bind(&DSZone::__onSurfaceCreated, this, std::placeholders::_1)); + __waylandCompositor->registerCallbackSurfaceDestroy(this, std::bind(&DSZone::__onSurfaceDestroy, this, std::placeholders::_1)); + } __wm = DSWindowManager::getInstance(); if (__wm) -- 2.7.4