Permalink
Browse files

adding better checking in background.html

  • Loading branch information...
1 parent 2d2e879 commit 529ec2afb354bfbeac8af4dc70c9d214e4ac7792 @kotfic kotfic committed Mar 27, 2012
Showing with 17 additions and 4 deletions.
  1. +17 −4 background.html
View
@@ -161,25 +161,38 @@
getSpaceBaseUrl : function( uri ){
if( !uri ) { uri = ''; }
+
if( this.AssemblaAPI.defaults.url ){
return this.AssemblaAPI.defaults.url + "/spaces/" + uri;
}
return '';
},
getSpaceName : function( space_id ){
- return this.getActiveSpaces().get(space_id).get("name");
+ if( this.getActiveSpaces().length ){
+ return this.getActiveSpaces().get(space_id).get("name");
+ }
+ return "";
},
getWikiName : function( space_id ){
- return this.getActiveSpaces().get(space_id).get("wiki_name");
+ if( this.getActiveSpaces().length ){
+ return this.getActiveSpaces().get(space_id).get("wiki_name");
+ }
+ return ""
},
getTicketNumber : function( ticket_id ){
- return this.getActiveTickets().get(ticket_id).get("number");
+ if( this.getActiveSpaces().length ){
+ return this.getActiveTickets().get(ticket_id).get("number");
+ }
+ return "";
},
getSpace : function( space_id, callback ){
- return this.getActiveSpaces().get(space_id);
+ if( this.getActiveSpaces().length ){
+ return this.getActiveSpaces().get(space_id);
+ }
+ return {};
},
run : function() {

0 comments on commit 529ec2a

Please sign in to comment.