From 1dac9d611f3e0e1c354264a5752a8484bf05d805 Mon Sep 17 00:00:00 2001 From: Felix Eckhofer <felix@eckhofer.com> Date: Thu, 19 Dec 2024 22:38:42 +0100 Subject: [PATCH] Prevent another Javascript error --- app/views/conferences/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/conferences/show.html.erb b/app/views/conferences/show.html.erb index f263a33..c72964c 100644 --- a/app/views/conferences/show.html.erb +++ b/app/views/conferences/show.html.erb @@ -10,7 +10,7 @@ current_time = Time.zone.now.in_time_zone(@conference.time_zone) <%= turbo_stream_from @conference %> <div> <div> - <a href="#now" onclick="document.querySelector('#now').scrollIntoView({ behavior: 'smooth', block: 'center', inline: 'nearest' }); return false" class="underline text-blue-500">Jump to current time</a> + <a href="#now" onclick="document.querySelector('#now')?.scrollIntoView({ behavior: 'smooth', block: 'center', inline: 'nearest' }); return false" class="underline text-blue-500">Jump to current time</a> </div> <h1 class="text-2xl font-bold my-2"><%= @conference.name %></h1> <p class="text-xs mb-6"> -- GitLab