Skip to content

Commit

Permalink
Safe-guard sg retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
LFDM committed Jul 7, 2014
1 parent e644a93 commit b991d0a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/js/services/treebank_retriever.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ angular.module('arethusa').factory('TreebankRetriever', [
head: { id: idHandler.getId(token._head) },
};

if (token._sg) {
obj.sg = { ancestors: token._sg.split(' ') };
var sg = token._sg;
if (sg && !sg.match(/^\s*$/)) {
obj.sg = { ancestors: sg.split(' ') };
}

return obj;
Expand Down

0 comments on commit b991d0a

Please sign in to comment.