From b9229ba75fb458355acfb0b2d12cec723b719900 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Tue, 23 Jun 2015 11:12:29 +0200 Subject: [PATCH] Don't try to get data when there's no user. --- js/h5p.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/h5p.js b/js/h5p.js index 2137da4..04acfe1 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -1692,6 +1692,12 @@ H5P.createTitle = function (rawTitle, maxLength) { * @param {boolean} [async=true] */ function contentUserDataAjax(contentId, dataType, subContentId, done, data, preload, invalidate, async) { + if (H5PIntegration.user === undefined) { + // Not logged in, no use in saving. + done('Not signed in.'); + return; + } + var options = { url: H5PIntegration.ajax.contentUserData.replace(':contentId', contentId).replace(':dataType', dataType).replace(':subContentId', subContentId ? subContentId : 0), dataType: 'json',