From 700b61ed2ca3a726a23dd9ba6413ad4c50dbeae0 Mon Sep 17 00:00:00 2001 From: ChangHyun Lee Date: Wed, 15 Mar 2017 19:36:47 +0900 Subject: [PATCH] [TIC-Web] fix the exception when selected 'misc' - fix the exception when selected 'misc' Change-Id: I86e55b1a27a5fb08c545429ba64c0d61c19ba348 Signed-off-by: ChangHyun Lee --- public/src/js/page/package.js | 53 ++++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/public/src/js/page/package.js b/public/src/js/page/package.js index fe3dc8d..6947842 100644 --- a/public/src/js/page/package.js +++ b/public/src/js/page/package.js @@ -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); } } -- 2.7.4