From 6d58338ef751b6e8a39fe8abc75e363ff69a1bcb Mon Sep 17 00:00:00 2001 From: David Coutadeur Date: Thu, 31 Oct 2024 17:32:35 +0100 Subject: [PATCH] fix local ppolicy loading on pages where policy.tpl is not included (#36) --- src/ppolicy/js/ppolicy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ppolicy/js/ppolicy.js b/src/ppolicy/js/ppolicy.js index 14af947..0ecc468 100644 --- a/src/ppolicy/js/ppolicy.js +++ b/src/ppolicy/js/ppolicy.js @@ -11,7 +11,7 @@ barWidth = new Map([["Err", "0"], ["0", "20"], ["1", "40"], ["2", "60"], ["3", "80"], ["4", "100"]]); - json_policy = $("#json-policy").data('policy'); + json_policy = $("#json-policy").data('policy') || btoa("{}") ; var local_policy = JSON.parse(atob(json_policy)); displayEntropyBar = function(level) {