From 4540b880945804e23e8ca31d50c1577e63686740 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Fri, 24 Jun 2022 14:39:02 -0700 Subject: [PATCH] [Sandbox Broker] Copy results array Hopefully this heads off a crash elsewhere. Signed-off-by: Christopher Snowhill --- Utils/SandboxBroker.m | 1 + 1 file changed, 1 insertion(+) diff --git a/Utils/SandboxBroker.m b/Utils/SandboxBroker.m index c160ecfe6..afdfce34a 100644 --- a/Utils/SandboxBroker.m +++ b/Utils/SandboxBroker.m @@ -163,6 +163,7 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc NSError *error = nil; NSArray *results = [pc.viewContext executeFetchRequest:request error:&error]; + if(results) results = [results copy]; if(results && [results count] > 0) { for(SandboxToken *token in results) {