From af99ee2214936166eb5ab4d812bdd9a9f71aa661 Mon Sep 17 00:00:00 2001 From: Rob Kooper Date: Fri, 11 Jul 2025 11:02:02 -0400 Subject: [PATCH] Fix NoSuchElementException for anonymous users in spaces listing and miniList templates - Add user existence checks before accessing user properties in app/views/spaces/listSpaces.scala.html and app/views/spaces/miniList.scala.html - Update CHANGELOG.md with details of the fix in Unreleased section --- CHANGELOG.md | 5 +++++ app/views/spaces/listSpaces.scala.html | 16 +++++++++------- app/views/spaces/miniList.scala.html | 2 +- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37eb95678..5ad9f5875 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## Unreleased + +### Fixed +- Fixed `NoSuchElementException` in spaces listing page when user is not defined. The error occurred when calling `user.get.id` on an undefined user in the spaces ownership dropdown. Added proper user existence checks in `listSpaces.scala.html` and `miniList.scala.html` templates. + ## 1.22.1 - 2023-11-10 ### Fixed diff --git a/app/views/spaces/listSpaces.scala.html b/app/views/spaces/listSpaces.scala.html index 9f62efefb..5c3bd3e22 100644 --- a/app/views/spaces/listSpaces.scala.html +++ b/app/views/spaces/listSpaces.scala.html @@ -47,13 +47,15 @@

@title

case (_, _) => {} } } -
- -
+ @if(user.isDefined) { +
+ +
+ }