Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
formatting nits
  • Loading branch information
hramos authored Jan 15, 2019
commit 39b94d07d3ea7fe466fd93c3c267ce6649a0ad57
18 changes: 9 additions & 9 deletions React/Modules/RCTAsyncLocalStorage.m
Original file line number Diff line number Diff line change
Expand Up @@ -242,20 +242,20 @@ - (NSDictionary *)_ensureSetup
NSDictionary *errorOut = nil;
NSString *serialized = RCTReadFile(RCTGetManifestFilePath(), RCTManifestFileName, &errorOut);
if (!serialized) {
if (errorOut) {
// We cannot simply create a new manifest in case the file does exist but we have no access to it.
// This can happen when data protection is enabled for the app and we are trying to read the manifect
// while the device is locked. (The app can be started by the system even if the device is locked due to
// e.g. a geofence event.)
RCTLogError(@"Could not open the existing manifest, perhaps data protection is enabled?\n\n%@", errorOut);
return errorOut;
if (errorOut) {
// We cannot simply create a new manifest in case the file does exist but we have no access to it.
// This can happen when data protection is enabled for the app and we are trying to read the manifect
// while the device is locked. (The app can be started by the system even if the device is locked due to
// e.g. a geofence event.)
RCTLogError(@"Could not open the existing manifest, perhaps data protection is enabled?\n\n%@", errorOut);
return errorOut;
} else {
// We can get nil without errors only when the file does not exist.
// We can get nil without errors only when the file does not exist.
RCTLogTrace(@"Manifest does not exist - creating a new one.\n\n%@", errorOut);
_manifest = [NSMutableDictionary new];
}
} else {
_manifest = RCTJSONParseMutable(serialized, &error);
_manifest = RCTJSONParseMutable(serialized, &error);
if (!_manifest) {
RCTLogError(@"Failed to parse manifest - creating a new one.\n\n%@", error);
_manifest = [NSMutableDictionary new];
Expand Down