diff --git a/src/platform/Darwin/KeyValueStoreManagerImpl.mm b/src/platform/Darwin/KeyValueStoreManagerImpl.mm index 289357dac0f40e..ee8c789f9b6a28 100644 --- a/src/platform/Darwin/KeyValueStoreManagerImpl.mm +++ b/src/platform/Darwin/KeyValueStoreManagerImpl.mm @@ -156,7 +156,7 @@ - (instancetype)initWithContext:(nonnull NSManagedObjectContext *)context key:(n ReturnErrorCodeIf(filepath == nil, CHIP_ERROR_INVALID_ARGUMENT); // relative paths are relative to Documents folder - if ([filepath hasPrefix:@"/"]) { + if (![filepath hasPrefix:@"/"]) { NSURL * documentsDirectory = [NSFileManager.defaultManager URLForDirectory:NSDocumentDirectory inDomain:NSUserDomainMask appropriateForURL:nil