Fix defects detected by static analysis tool 28/298828/1
authorJi-hoon Lee <dalton.lee@samsung.com>
Thu, 14 Sep 2023 04:36:23 +0000 (13:36 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Thu, 14 Sep 2023 04:36:23 +0000 (13:36 +0900)
Change-Id: I02f13a7e341e9afd8c0d325bc0c2630376f17778

src/mmi-manager/mmi-node-prototype.cpp

index 2cb9a77e73183d4232dabd009dcc9d688b5154c6..d5235fb0b801caf91d5f758026097901ab64d11f 100644 (file)
@@ -116,8 +116,10 @@ bool NodePrototype::add_attribute_info(AttributeInfo &attribute_info) {
 
 mmi_standard_node_type_e NodePrototype::get_type() {
     mmi_standard_node_type_e ret = MMI_STANDARD_NODE_TYPE_NONE;
-    if (m_type.has_value()) {
+    try {
         ret = m_type.value();
+    } catch (const std::bad_optional_access &e) {
+        _E("[std::bad_optional_access] Failed to get node type: %s", e.what());
     }
     return ret;
 }