From: Ji-hoon Lee Date: Thu, 14 Sep 2023 05:50:09 +0000 (+0900) Subject: Fix defects detected by static analysis tool X-Git-Tag: accepted/tizen/unified/20231219.041318~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=96b4c9c2b73993b1143bd9955b5e095b33efc3bd;p=platform%2Fcore%2Fuifw%2Fmmi-framework.git Fix defects detected by static analysis tool Change-Id: Idf238fe31b857a47d847a13902e7bdcd5a328df5 --- diff --git a/src/mmi-manager/mmi-node-prototype.cpp b/src/mmi-manager/mmi-node-prototype.cpp index d5235fb..2a6aa31 100644 --- a/src/mmi-manager/mmi-node-prototype.cpp +++ b/src/mmi-manager/mmi-node-prototype.cpp @@ -126,8 +126,10 @@ mmi_standard_node_type_e NodePrototype::get_type() { mmi_standard_node_sub_type_e NodePrototype::get_sub_type() { mmi_standard_node_sub_type_e ret = std::monostate{}; - if (m_sub_type.has_value()) { + try { ret = m_sub_type.value(); + } catch (const std::bad_optional_access &e) { + _E("[std::bad_optional_access] Failed to get node sub_type: %s", e.what()); } return ret; }