From 7ae6c6cc557ef4d8b09ac14672dfbae1ff3cf7c0 Mon Sep 17 00:00:00 2001 From: Thierry Carrez Date: Tue, 27 Oct 2020 16:15:33 +0100 Subject: [PATCH] Fix issue in case unknown location is provided Using the "location" command to point to an unknown location would cause the Javascript displaying the schedule to crash. It's a bit useless to use that command in a virtual PTG with meeting URLs, however the page should handle that case and fail more gracefully. Change-Id: I271e2ead0094d407274cbb22e499d7b2c49631b4 --- README.rst | 4 +++- html/ptg.js | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 2dd4ee6..e1c6fc6 100644 --- a/README.rst +++ b/README.rst @@ -186,7 +186,9 @@ location The room your track discussions happen in should be filled automatically by the PTGbot by looking up the schedule information. In case it's not right, -you can overwrite it using the ``location`` command. Example usage:: +you can overwrite it using the ``location`` command. This command is +useless in a virtual PTG, where you should use the "url" command to update +the virtual meeting location. Example usage:: #oslo location Level B, Ballroom A diff --git a/html/ptg.js b/html/ptg.js index 6af5fa0..757c832 100644 --- a/html/ptg.js +++ b/html/ptg.js @@ -77,7 +77,11 @@ Handlebars.registerHelper('trackbadge', roomurl = urls[track]; } else { if (locations[track] != undefined) { - roomurl = schedule[locations[track]]['url']; + if (schedule[locations[track]] != undefined) { + roomurl = schedule[locations[track]]['url']; + } else { + roomurl = undefined; + } } else { roomurl = undefined; }