diff options
author | Olivier Lamy <olamy@apache.org> | 2012-06-05 21:44:13 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2012-06-05 21:44:13 +0000 |
commit | f31f36553560b16931149082b4ba724484877c0e (patch) | |
tree | db14ca97e8e96797e8b3797ac16b6a40eea54f17 | |
parent | 0af5a819d92981b42c6baba9324173c931bcf02d (diff) | |
download | archiva-f31f36553560b16931149082b4ba724484877c0e.tar.gz archiva-f31f36553560b16931149082b4ba724484877c0e.zip |
prevent js npe
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1346613 13f79535-47bb-0310-9956-ffa450edef68
2 files changed, 17 insertions, 11 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js index 31f1394ee..13d048086 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js @@ -895,7 +895,7 @@ define("search",["jquery","i18n","jquery.tmpl","choosen","order!knockout","knock } return projectVersionMetadata; } - return null; + return new ProjectVersionMetadata(); } MavenFacet=function(packaging,parent){ diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html index 2a656b4b1..35a0bf1ca 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html @@ -468,17 +468,23 @@ </tr> <tr> <th>${$.i18n.prop('browse.artifact.packaging')}</th> - <td>${projectVersionMetadata.mavenFacet.packaging}</td> - </tr> - {{if projectVersionMetadata.mavenFacet.parent }} - <tr> - <th>${$.i18n.prop('browse.artifact.parent')}</th> - <td> - <a href="#" data-bind="click: displayParent"> - ${projectVersionMetadata.mavenFacet.parent.groupId}:${projectVersionMetadata.mavenFacet.parent.artifactId}:${projectVersionMetadata.mavenFacet.parent.version} - </a> - </td> + {{if projectVersionMetadata.mavenFacet}} + <td>${projectVersionMetadata.mavenFacet.packaging}</td> + {{else}} + <td></td> + {{/if}} </tr> + {{if projectVersionMetadata.mavenFacet}} + {{if projectVersionMetadata.mavenFacet.parent }} + <tr> + <th>${$.i18n.prop('browse.artifact.parent')}</th> + <td> + <a href="#" data-bind="click: displayParent"> + ${projectVersionMetadata.mavenFacet.parent.groupId}:${projectVersionMetadata.mavenFacet.parent.artifactId}:${projectVersionMetadata.mavenFacet.parent.version} + </a> + </td> + </tr> + {{/if}} {{/if}} </tbody> </table> |