diff --git a/source/Lib/CommonLib/Unit.cpp b/source/Lib/CommonLib/Unit.cpp
index e19584d4b9f997884c411560b1b36411c7f035a0..5eaf5011aa24083c0dd69b2bea02bf2d3b3d2a0b 100644
--- a/source/Lib/CommonLib/Unit.cpp
+++ b/source/Lib/CommonLib/Unit.cpp
@@ -344,7 +344,7 @@ void CodingUnit::initData()
   ispMode           = ISPType::NONE;
   mipFlag           = false;
 
-  if (slice && slice->getSPS() && slice->getSPS()->getPLTMode())
+  if (cs && cs->sps->getPLTMode())
   {
     for (int idx = 0; idx < MAX_NUM_CHANNEL_TYPE; idx++)
     {