From 329241bcde65222d6aeb01b2facddde64076eabf Mon Sep 17 00:00:00 2001 From: Lordfox Date: Sat, 4 Oct 2025 12:10:40 +0200 Subject: [PATCH] hups :) --- .../Modules/ConcurrentFlotsamAssetCache.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/OpenSimConcurrentFlotsamAssetCache/addon-modules/OpenSimConcurrentFlotsamAssetCache/Modules/ConcurrentFlotsamAssetCache.cs b/modules/OpenSimConcurrentFlotsamAssetCache/addon-modules/OpenSimConcurrentFlotsamAssetCache/Modules/ConcurrentFlotsamAssetCache.cs index 01b6fdb..d5010a4 100644 --- a/modules/OpenSimConcurrentFlotsamAssetCache/addon-modules/OpenSimConcurrentFlotsamAssetCache/Modules/ConcurrentFlotsamAssetCache.cs +++ b/modules/OpenSimConcurrentFlotsamAssetCache/addon-modules/OpenSimConcurrentFlotsamAssetCache/Modules/ConcurrentFlotsamAssetCache.cs @@ -547,9 +547,13 @@ namespace OpenSim.Region.CoreModules.Asset { weakAssetReferences.AddOrUpdate( key, - static _ => new WeakReference(asset), - static (_, existing) => + _ => new WeakReference(asset), + (_, existing) => { + // defensive: handle rare case where existing could be null + if (existing is null) + return new WeakReference(asset); + existing.SetTarget(asset); return existing; });