Skip to content

Commit

Permalink
Merge pull request mikekelly#44 from plexus/no_links
Browse files Browse the repository at this point in the history
Prevent error when document does not cotain _links
  • Loading branch information
mikekelly committed Jun 28, 2014
2 parents bc354a1 + 801407f commit 2e831af
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions js/hal.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
return str.replace(replaceRegex, '.../');
},
buildUrl: function(rel) {
if (!HAL.currentDocument._links) {
return rel;
}
if (!rel.match(urlRegex) && isCurie(rel) && HAL.currentDocument._links.curies) {
var parts = rel.split(':');
var curies = HAL.currentDocument._links.curies;
Expand Down

0 comments on commit 2e831af

Please sign in to comment.