From 13453f6a3013d5b3a1ff784dadf355efd0ca2049 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=8A=B2=E9=B9=8F?= Date: Sat, 23 Jan 2021 15:42:21 +0800 Subject: [PATCH] iOS: deal with context nil caused array init crash --- doric-iOS/Pod/Classes/Plugin/DoricPromise.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doric-iOS/Pod/Classes/Plugin/DoricPromise.m b/doric-iOS/Pod/Classes/Plugin/DoricPromise.m index c25e9027..72fb20b4 100644 --- a/doric-iOS/Pod/Classes/Plugin/DoricPromise.m +++ b/doric-iOS/Pod/Classes/Plugin/DoricPromise.m @@ -58,6 +58,9 @@ - (void)resolve:(id)result { - (void)reject:(id)result { __weak typeof(self) __self = self; + if (self.context == nil) { + return; + } [[self.context.driver invokeDoricMethod:DORIC_BRIDGE_REJECT argumentsArray:result ? @[self.context.contextId, self.callbackId, result]