From 2016948119b4f4116eac3095aee6eaf55765e9a7 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Sat, 2 Jun 2018 09:52:04 +0200 Subject: [PATCH] Don't try to listen to selector events if selector doesn't exist --- manuels/static/manuels/no_book.js | 1 + 1 file changed, 1 insertion(+) diff --git a/manuels/static/manuels/no_book.js b/manuels/static/manuels/no_book.js index ea762d7..5df85ea 100644 --- a/manuels/static/manuels/no_book.js +++ b/manuels/static/manuels/no_book.js @@ -1,5 +1,6 @@ document.addEventListener("DOMContentLoaded", function (event) { var _selector = document.querySelector('#id_no_book'); + if (_selector === null) return; _selector.addEventListener('change', function (event) { if (_selector.checked) { document.querySelector('#id_title').value = "PAS DE LIVRE POUR CETTE CLASSE";