DSZone: add null check for waylandCompositor variable 54/241854/1
authorSung-Jin Park <sj76.park@samsung.com>
Wed, 19 Aug 2020 05:54:02 +0000 (14:54 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Thu, 20 Aug 2020 10:12:12 +0000 (19:12 +0900)
Change-Id: I7883a7d0054a0aaf756b48b0d073071a56c24e96
Signed-off-by: Sung-Jin Park <sj76.park@samsung.com>
src/DSZone/DSZone.cpp

index 0b0f043..e127faa 100644 (file)
@@ -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)