Add checking nullptr 59/282459/2
authorChanggyu Choi <changyu.choi@samsung.com>
Tue, 4 Oct 2022 04:52:06 +0000 (13:52 +0900)
committerChanggyu Choi <changyu.choi@samsung.com>
Tue, 4 Oct 2022 05:07:52 +0000 (05:07 +0000)
GetMetaType() can return nullptr.
This patch adds to checking whether GetMetaType() return value is nullptr or not.

Change-Id: I8768bed1c7ed9ecd9b3ee024d2202543d4712327
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
idlc/gen/dart_gen_base.cc

index 281ed1097811486945ebfef309df34ec99f2d9d2..5f31c93fa6e1a498e3f876a9da0e13d7915ef60f 100644 (file)
@@ -577,7 +577,8 @@ std::string DartGeneratorBase::GetPrivateSharingString(const BaseType& type,
     const std::string& port, const std::string& arg) {
   std::string code;
   if (type.ToString() == "list" || type.ToString() == "array") {
-    if (type.GetMetaType()->ToString() == "file") {
+    if (type.GetMetaType() != nullptr &&
+        type.GetMetaType()->ToString() == "file") {
       code = ReplaceAll(CB_LIST_FILE_SET_PRIVATE_SHARING, {
             { "<PORT>", port },
             { "<ARG>", arg }