diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2026-05-29 14:56:23 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2026-05-29 14:56:23 +0200 |
| commit | ef6d16a799dbe7203ecc732abc558f02b46a8d2a (patch) | |
| tree | 0e7942af731a3143968277ffde3431cc80d7cd68 /cockpit | |
| parent | 0d74e04fae3fd118c207de0634b6463bd68f3890 (diff) | |
| download | bycs-sol-ef6d16a799dbe7203ecc732abc558f02b46a8d2a.tar.gz bycs-sol-ef6d16a799dbe7203ecc732abc558f02b46a8d2a.zip | |
cockpit: assert we have the a valid userId to fetch the icon
Diffstat (limited to 'cockpit')
| -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 { |
