From 7ed89476716d584b1e029e87041fcf3719f08b60 Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Wed, 26 Jul 2023 10:20:18 +0800 Subject: [PATCH] iOS: fix crash when flowlayout in wrong state --- doric-iOS/Pod/Classes/Shader/DoricFlowLayoutNode.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doric-iOS/Pod/Classes/Shader/DoricFlowLayoutNode.m b/doric-iOS/Pod/Classes/Shader/DoricFlowLayoutNode.m index f8932494..612494ed 100644 --- a/doric-iOS/Pod/Classes/Shader/DoricFlowLayoutNode.m +++ b/doric-iOS/Pod/Classes/Shader/DoricFlowLayoutNode.m @@ -377,7 +377,10 @@ - (NSDictionary *)itemModelAt:(NSUInteger)position { NSUInteger pos = position + idx; self.itemViewIds[@(pos)] = thisViewId; }]; - return array[0]; + if (array.count > 0 ) { + return array[0]; + } + return nil; } }