Fix unexpected error when no value of <name> tag in config.xml 46/41646/2 accepted/tizen/mobile/20150618.040522 accepted/tizen/tv/20150618.040537 accepted/tizen/wearable/20150618.040552 submit/tizen/20150618.021950
authorInhwan Lee <ideal.lee@samsung.com>
Wed, 17 Jun 2015 07:26:43 +0000 (16:26 +0900)
committerPawel Sikorski <p.sikorski@samsung.com>
Wed, 17 Jun 2015 08:18:05 +0000 (01:18 -0700)
When there is no  <name> tag in config.xml,
installer occur error unexpected because of empty string of manifest->uiapplication->label

Fix there are no <name> tag in config.xml, no <label> in manifest file

JIRA issue : http://168.219.209.56/jira/browse/XWALK-384

Change-Id: I236217e262faaaff6af3f2931568121ede51bbe8

src/common/step/step_generate_xml.cc
src/wgt/step/step_parse.cc

index a5508c6..73ab4d8 100755 (executable)
@@ -66,17 +66,18 @@ Step::Status StepGenerateXml::GenerateApplicationCommonXml(T* app,
   if (std::is_same<T, serviceapplication_x>::value)
     _writeServiceApplicationAttributes(
         writer, reinterpret_cast<serviceapplication_x *>(app));
-
-  label_x* label = nullptr;
-  LISTHEAD(app->label, label);
-  for (; label; label = label->next) {
-    xmlTextWriterStartElement(writer, BAD_CAST "label");
-    if (label->lang && strlen(label->lang)) {
-      xmlTextWriterWriteAttribute(writer, BAD_CAST "xml:lang",
-                                  BAD_CAST label->lang);
+  if(app->label){
+    label_x* label = nullptr;
+    LISTHEAD(app->label, label);
+    for (; label; label = label->next) {
+      xmlTextWriterStartElement(writer, BAD_CAST "label");
+      if (label->lang && strlen(label->lang)) {
+        xmlTextWriterWriteAttribute(writer, BAD_CAST "xml:lang",
+                                    BAD_CAST label->lang);
+      }
+      xmlTextWriterWriteString(writer, BAD_CAST label->name);
+      xmlTextWriterEndElement(writer);
     }
-    xmlTextWriterWriteString(writer, BAD_CAST label->name);
-    xmlTextWriterEndElement(writer);
   }
 
   // the icon is renamed to <appid.png>
index 584818c..45e467c 100644 (file)
@@ -271,8 +271,11 @@ common_installer::Step::Status StepParse::process() {
   const std::string& version = wgt_info->version();
   const std::string& required_api_version = info->required_version();
 
-  context_->config_data.get().application_name.set(
-      std::string(manifest->uiapplication->label->name));
+  if(manifest->uiapplication->label){
+    context_->config_data.get().application_name.set(
+        std::string(manifest->uiapplication->label->name));
+  }
+
   context_->config_data.get().required_version.set(required_api_version);
   context_->pkgid.set(std::string(manifest->package));