diff options
| -rw-r--r-- | cockpit/js/config.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cockpit/js/config.js b/cockpit/js/config.js index 545c579..2beb91b 100644 --- a/cockpit/js/config.js +++ b/cockpit/js/config.js @@ -27,9 +27,11 @@ function getCourseParticipantsUrl() { } async function getUserIconUrl(userId) { + console.assert(userId, "getUserIconUrl needs a userId"); const userRes = await fetch(`https://lernplattform.bycs.de/user/profile.php?id=${userId}`) const userDoc = new DOMParser().parseFromString(await userRes.text(), 'text/html') - return userDoc.querySelector(".userpicture").src; + const userpicture = userDoc.querySelector(".userpicture"); + return userpicture ? userpicture.src : ""; } export { |
