Skip to content

Commit

Permalink
fixed possible NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
jstrachan committed Oct 10, 2013
1 parent 6adb316 commit 7746c23
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions hawtio-web/src/main/webapp/app/wiki/js/view.ts
Expand Up @@ -62,17 +62,20 @@ module Wiki {

$scope.createDashboardLink = () => {
var href = '/wiki/branch/:branch/view/*page';
var title = $routeParams['page'].split("/").last();
var page = $routeParams['page'];
var title = page ? page.split("/").last() : null;
var size = angular.toJson({
size_x: 2,
size_y: 2
});

return "#/dashboard/add?tab=dashboard" +
var answer = "#/dashboard/add?tab=dashboard" +
"&href=" + encodeURIComponent(href) +
"&size=" + encodeURIComponent(size) +
"&title=" + encodeURIComponent(title) +
"&routeParams=" + encodeURIComponent(angular.toJson($routeParams));
if (title) {
answer += "&title=" + encodeURIComponent(title);
}
return answer;
};

$scope.childLink = (child) => {
Expand Down

0 comments on commit 7746c23

Please sign in to comment.