iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage

Summary: Changelog: [Internal]

Differential Revision: D30081478

fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29
This commit is contained in:
Paige Sun
2021-08-03 16:41:32 -07:00
committed by Facebook GitHub Bot
parent c39a4c7f2e
commit 363a8fb08c
@@ -306,7 +306,11 @@ RCT_EXPORT_MODULE()
if (errorOut) {
return errorOut;
}
if (![entry[1] isKindOfClass:[NSString class]]) {
return RCTMakeAndLogError(@"Invalid value for entry - must be a string. Got entry: ", entry, nil);
}
NSString *value = entry[1];
NSString *filePath = [self _filePathForKey:key];
NSError *error;
if (value.length <= RCTInlineValueThreshold) {