diff options
author | June McEnroe <june@causal.agency> | 2024-09-07 21:02:03 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2024-09-07 21:02:03 -0400 |
commit | 74df90da35ed7886c4067fae700c9db1d3b2ef0a (patch) | |
tree | ac1e043c037dfde6d63b46a9f094151921f6725a /www | |
parent | Fancy up the text a little (diff) | |
download | src-74df90da35ed7886c4067fae700c9db1d3b2ef0a.tar.gz src-74df90da35ed7886c4067fae700c9db1d3b2ef0a.zip |
Handle no film being loaded
Diffstat (limited to 'www')
-rw-r--r-- | www/photo.causal.agency/trips.html | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/www/photo.causal.agency/trips.html b/www/photo.causal.agency/trips.html index d6c41c3a..6c65b7c0 100644 --- a/www/photo.causal.agency/trips.html +++ b/www/photo.causal.agency/trips.html @@ -219,10 +219,16 @@ function setTripBody() { select.appendChild(option); } let roll = rolls[body.name]; - document.getElementById("trip-film").value = roll.film; - let next = (roll.used > 0 ? roll.used + 1 : roll.used); - document.getElementById("trip-first").value = next; - document.getElementById("trip-last").value = next; + if (roll) { + document.getElementById("trip-film").value = roll.film; + let next = (roll.used > 0 ? roll.used + 1 : roll.used); + document.getElementById("trip-first").value = next; + document.getElementById("trip-last").value = next; + } else { + document.getElementById("trip-film").value = ""; + document.getElementById("trip-first").value = ""; + document.getElementById("trip-last").value = ""; + } } setTripBody(); |