Skip to content

Commit

Permalink
#877 attempt to fix potential NPE with toastr if its not been initial…
Browse files Browse the repository at this point in the history
…ised by the time we create the angular service
  • Loading branch information
jstrachan committed Dec 20, 2013
1 parent 7b49e23 commit d0400e4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion hawtio-web/src/main/webapp/app/core/js/corePlugin.ts
Expand Up @@ -284,7 +284,14 @@ angular.module(Core.pluginName, ['bootstrap', 'ngResource', 'ui', 'ui.bootstrap.
}
}).
factory('toastr', () => {
return (<any>window).toastr;
var win: any = window;
var answer: any = win.toastr;
if (!answer) {
// lets avoid any NPEs
answer = {};
win.toaster = answer;
}
return answer;
}).
factory('xml2json', ($window) => {
var jquery:any = $;
Expand Down

0 comments on commit d0400e4

Please sign in to comment.