Fix coverity issue on dli loader : Add null check 61/272161/1
authorEunki, Hong <eunkiki.hong@samsung.com>
Thu, 10 Mar 2022 07:51:03 +0000 (16:51 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Thu, 10 Mar 2022 07:51:03 +0000 (16:51 +0900)
Add some null checker branch on dli-loader which can be nullptr

Change-Id: I716b21f041a712bc66a31471c1fd9ae966ecc6b3
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
dali-scene-loader/public-api/dli-loader.cpp

index 18214dd..48a82c3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -1626,14 +1626,13 @@ void DliLoader::Impl::ParseAnimations(const TreeNode* tnAnimations, LoadParams&
           if(tnValue)
           {
             animProp.mValue.reset(new AnimatedProperty::Value{ReadPropertyValue(*tnValue)});
+            ReadBool(tnProperty.GetChild("relative"), animProp.mValue->mIsRelative);
           }
           else
           {
             mOnError(FormatString("Property '%s' fails to define target value.",
                                   animProp.mPropertyName.c_str()));
           }
-
-          ReadBool(tnProperty.GetChild("relative"), animProp.mValue->mIsRelative);
         }
 
         animDef.mProperties.push_back(std::move(animProp));