Skip to content

Commit

Permalink
chore(ios): add Invalid prop keyPath check
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwcg committed Oct 12, 2024
1 parent 9f3724a commit 2e47c11
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ios/sdk/base/HippyComponentData.mm
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ - (HippyPropBlock)propBlockForKey:(NSString *)name inDictionary:(NSMutableDictio
NSArray<NSString *> *parts = [keyPath componentsSeparatedByString:@"."];
if (parts) {
key = parts.lastObject;
HippyAssert(key, @"Invalid KeyPath, please check your prop define!");
parts = [parts subarrayWithRange:(NSRange) { 0, parts.count - 1 }];
}

Expand Down Expand Up @@ -242,7 +243,7 @@ - (HippyPropBlock)propBlockForKey:(NSString *)name inDictionary:(NSMutableDictio
[weakManager.bridge.eventDispatcher dispatchEvent:@"EventDispatcher" methodName:@"receiveNativeGesture" args:params];
} else {
[params setValue:body ?: @{} forKey:@"extra"];
[params setObject:key forKey:@"eventName"];
[params setObject:key ?: @"" forKey:@"eventName"];
[weakManager.bridge.eventDispatcher dispatchEvent:@"EventDispatcher" methodName:@"receiveUIComponentEvent"
args:params];
}
Expand Down

0 comments on commit 2e47c11

Please sign in to comment.