[TIC-Web] fix the exception when selected 'misc' 72/119072/1
authorChangHyun Lee <leechwin.lee@samsung.com>
Wed, 15 Mar 2017 10:36:47 +0000 (19:36 +0900)
committerChangHyun Lee <leechwin.lee@samsung.com>
Wed, 15 Mar 2017 10:36:47 +0000 (19:36 +0900)
- fix the exception when selected 'misc'

Change-Id: I86e55b1a27a5fb08c545429ba64c0d61c19ba348
Signed-off-by: ChangHyun Lee <leechwin.lee@samsung.com>
public/src/js/page/package.js

index fe3dc8d..6947842 100644 (file)
@@ -901,30 +901,37 @@ define([
 
         var pkg = pkgInfo[node.text];
 
-        if (!_.isEmpty(pkg.name)) {
-            text.html(pkg.name);
-        }
-        if (!_.isEmpty(pkg.version)) {
-            if (!_.isEmpty(pkg.version.rel)) {
-                version.html(pkg.version.ver + '-' + pkg.version.rel);
-            } else {
-                version.html(pkg.version.ver);
+        if (!_.isEmpty(pkg)) {
+            if (!_.isEmpty(pkg.name)) {
+                text.html(pkg.name);
+            }
+            if (!_.isEmpty(pkg.version)) {
+                if (!_.isEmpty(pkg.version.rel)) {
+                    version.html(pkg.version.ver + '-' + pkg.version.rel);
+                } else {
+                    version.html(pkg.version.ver);
+                }
+            }
+            if (!_.isEmpty(pkg.arch)) {
+                arch.html(pkg.arch);
+            }
+            if (!_.isEmpty(pkg.size)) {
+                size.html(Util.bytesToSize(pkg.size));
+            }
+            if (!_.isEmpty(pkg.installed)) {
+                installedSize.html(Util.bytesToSize(pkg.installed));
+            }
+            if (!_.isEmpty(pkg.summary)) {
+                summary.html(pkg.summary);
+            }
+            if (!_.isEmpty(pkg.description)) {
+                description.html(pkg.description);
+            }
+        } else {
+            // 'MISC' case
+            if (!_.isEmpty(node.text)) {
+                text.html(node.text);
             }
-        }
-        if (!_.isEmpty(pkg.arch)) {
-            arch.html(pkg.arch);
-        }
-        if (!_.isEmpty(pkg.size)) {
-            size.html(Util.bytesToSize(pkg.size));
-        }
-        if (!_.isEmpty(pkg.installed)) {
-            installedSize.html(Util.bytesToSize(pkg.installed));
-        }
-        if (!_.isEmpty(pkg.summary)) {
-            summary.html(pkg.summary);
-        }
-        if (!_.isEmpty(pkg.description)) {
-            description.html(pkg.description);
         }
     }