Skip to content

Commit 9c13507

Browse files
committed
- Fixed an issue that caused getSamples to discard workouts with no metadata
1 parent 1a5557f commit 9c13507

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

RCTAppleHealthKit/RCTAppleHealthKit+Queries.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ - (void)fetchSamplesOfType:(HKSampleType *)type
348348
@"activityName" : type,
349349
@"calories" : @(energy),
350350
@"tracked" : @(isTracked),
351-
@"metadata" : [sample metadata],
351+
@"metadata" : [sample metadata] ? [sample metadata] : [NSNull null],
352352
@"sourceName" : [[[sample sourceRevision] source] name],
353353
@"sourceId" : [[[sample sourceRevision] source] bundleIdentifier],
354354
@"device": device,

0 commit comments

Comments
 (0)