From 801407fffa08e545b2bc05990af17650940956aa Mon Sep 17 00:00:00 2001 From: Arne Brasseur Date: Thu, 26 Jun 2014 10:25:30 +0200 Subject: [PATCH] Prevent error when document does not cotain _links --- js/hal.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/hal.js b/js/hal.js index 7981dae..0bbfd5a 100644 --- a/js/hal.js +++ b/js/hal.js @@ -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;