From 1a2d7cd3ae509bbfa5f932af5791dfe12de59ff1 Mon Sep 17 00:00:00 2001 From: Alexey <248997@gmail.com> Date: Sat, 7 Sep 2024 16:17:32 +0500 Subject: [PATCH] fix(mission-server): Fix GetItemsSnapshot return type Changed the return type of GetItemsSnapshot to ImmutableArray. This ensures the returned collection is immutable, providing better security and stability. --- .../Microservices/Missions/Server/Ex/MissionServerEx.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Asv.Mavlink/Microservices/Missions/Server/Ex/MissionServerEx.cs b/src/Asv.Mavlink/Microservices/Missions/Server/Ex/MissionServerEx.cs index f31c571b..c1978630 100644 --- a/src/Asv.Mavlink/Microservices/Missions/Server/Ex/MissionServerEx.cs +++ b/src/Asv.Mavlink/Microservices/Missions/Server/Ex/MissionServerEx.cs @@ -138,7 +138,7 @@ public void RemoveItems(IEnumerable items) public ImmutableArray GetItemsSnapshot() { - return [.._missionSource.Items]; + return _missionSource.Items.ToImmutableArray(); } }