diff --git a/.changeset/cozy-beans-bow.md b/.changeset/cozy-beans-bow.md new file mode 100644 index 00000000..ee8cd356 --- /dev/null +++ b/.changeset/cozy-beans-bow.md @@ -0,0 +1,6 @@ +--- +"@kingstinct/react-native-healthkit": patch +--- + +Fix native error on queryCorrelationSamples when no data available + \ No newline at end of file diff --git a/packages/react-native-healthkit/ios/CorrelationTypeModule.swift b/packages/react-native-healthkit/ios/CorrelationTypeModule.swift index 23468330..67e6a451 100644 --- a/packages/react-native-healthkit/ios/CorrelationTypeModule.swift +++ b/packages/react-native-healthkit/ios/CorrelationTypeModule.swift @@ -100,7 +100,7 @@ class CorrelationTypeModule: HybridCorrelationTypeModuleSpec { return } - guard let correlations = correlations else { + guard let correlations = correlations, !correlations.isEmpty else { continuation.resume(returning: []) return }