From 90a16c895126575db98c466409140d0364817053 Mon Sep 17 00:00:00 2001 From: wentianen <1206860151@qq.com> Date: Fri, 24 Feb 2017 17:09:16 +0800 Subject: [PATCH] fix crash [WebViewProxyURLProtocol findRequestMatcher:] Collection <__NSArrayM: 0x1702504d0> was mutated while being enumerated --- WebViewProxy/WebViewProxy.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/WebViewProxy/WebViewProxy.m b/WebViewProxy/WebViewProxy.m index bbb5ace..e0543fd 100644 --- a/WebViewProxy/WebViewProxy.m +++ b/WebViewProxy/WebViewProxy.m @@ -213,7 +213,8 @@ @implementation WebViewProxyURLProtocol { } @synthesize proxyResponse=_proxyResponse, requestMatcher=_requestMatcher; + (WVPRequestMatcher *)findRequestMatcher:(NSURL *)url { - for (WVPRequestMatcher* requestMatcher in requestMatchers) { + NSMutableArray* requestMatchersCopy = [requestMatchers mutableCopy]; + for (WVPRequestMatcher* requestMatcher in requestMatchersCopy) { if ([requestMatcher.predicate evaluateWithObject:url]) { return requestMatcher; }