prevent js npe

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1346613 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-06-05 21:44:13 +00:00
parent 0af5a819d9
commit f31f365535
2 changed files with 17 additions and 11 deletions

View File

@ -895,7 +895,7 @@ define("search",["jquery","i18n","jquery.tmpl","choosen","order!knockout","knock
} }
return projectVersionMetadata; return projectVersionMetadata;
} }
return null; return new ProjectVersionMetadata();
} }
MavenFacet=function(packaging,parent){ MavenFacet=function(packaging,parent){

View File

@ -468,17 +468,23 @@
</tr> </tr>
<tr> <tr>
<th>${$.i18n.prop('browse.artifact.packaging')}</th> <th>${$.i18n.prop('browse.artifact.packaging')}</th>
<td>${projectVersionMetadata.mavenFacet.packaging}</td> {{if projectVersionMetadata.mavenFacet}}
</tr> <td>${projectVersionMetadata.mavenFacet.packaging}</td>
{{if projectVersionMetadata.mavenFacet.parent }} {{else}}
<tr> <td></td>
<th>${$.i18n.prop('browse.artifact.parent')}</th> {{/if}}
<td>
<a href="#" data-bind="click: displayParent">
${projectVersionMetadata.mavenFacet.parent.groupId}:${projectVersionMetadata.mavenFacet.parent.artifactId}:${projectVersionMetadata.mavenFacet.parent.version}
</a>
</td>
</tr> </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}} {{/if}}
</tbody> </tbody>
</table> </table>