Improved GetLocation() ability to handle nulls

This commit is contained in:
Chomp
2025-06-22 12:57:26 +01:00
parent 1520cfadc3
commit 1087b32e13
@@ -121,8 +121,7 @@ public class DatabaseService(
/// <returns> assets/database/locations/ </returns>
public Location? GetLocation(string locationId)
{
var locations = GetLocations();
var desiredLocation = locations.GetByJsonProp<Location>(locationId.ToLower());
var desiredLocation = GetLocations()?.GetByJsonProp<Location>(locationId.ToLower());
if (desiredLocation == null)
{
_logger.Error(