@@ -35,7 +35,7 @@ - (void)fitness_getStepCountOnDay:(NSDictionary *)input callback:(RCTResponseSen
35
35
includeManuallyAdded: includeManuallyAdded
36
36
day: date
37
37
completion: ^(double value, NSDate *startDate, NSDate *endDate, NSError *error) {
38
- if (!value && value != 0 ) {
38
+ if (( !value && value != 0 ) || error != nil ) {
39
39
callback (@[RCTJSErrorFromNSError (error)]);
40
40
return ;
41
41
}
@@ -218,7 +218,7 @@ - (void)fitness_getDistanceWalkingRunningOnDay:(NSDictionary *)input callback:(R
218
218
HKQuantityType *quantityType = [HKObjectType quantityTypeForIdentifier: HKQuantityTypeIdentifierDistanceWalkingRunning];
219
219
220
220
[self fetchSumOfSamplesOnDayForType: quantityType unit: unit includeManuallyAdded: includeManuallyAdded day: date completion: ^(double distance, NSDate *startDate, NSDate *endDate, NSError *error) {
221
- if (!distance && distance != 0 ) {
221
+ if (( !distance && distance != 0 ) || error != nil ) {
222
222
callback (@[RCTJSErrorFromNSError (error)]);
223
223
return ;
224
224
}
@@ -277,7 +277,7 @@ - (void)fitness_getDistanceSwimmingOnDay:(NSDictionary *)input callback:(RCTResp
277
277
HKQuantityType *quantityType = [HKObjectType quantityTypeForIdentifier: HKQuantityTypeIdentifierDistanceSwimming];
278
278
279
279
[self fetchSumOfSamplesOnDayForType: quantityType unit: unit includeManuallyAdded: includeManuallyAdded day: date completion: ^(double distance, NSDate *startDate, NSDate *endDate, NSError *error) {
280
- if (!distance && distance != 0 ) {
280
+ if (( !distance && distance != 0 ) || error != nil ) {
281
281
callback (@[RCTJSErrorFromNSError (error)]);
282
282
return ;
283
283
}
@@ -334,7 +334,7 @@ - (void)fitness_getDistanceCyclingOnDay:(NSDictionary *)input callback:(RCTRespo
334
334
HKQuantityType *quantityType = [HKObjectType quantityTypeForIdentifier: HKQuantityTypeIdentifierDistanceCycling];
335
335
336
336
[self fetchSumOfSamplesOnDayForType: quantityType unit: unit includeManuallyAdded: includeManuallyAdded day: date completion: ^(double distance, NSDate *startDate, NSDate *endDate, NSError *error) {
337
- if (!distance && distance != 0 ) {
337
+ if (( !distance && distance != 0 ) || error != nil ) {
338
338
callback (@[RCTJSErrorFromNSError (error)]);
339
339
return ;
340
340
}
@@ -391,7 +391,7 @@ - (void)fitness_getFlightsClimbedOnDay:(NSDictionary *)input callback:(RCTRespon
391
391
HKQuantityType *quantityType = [HKObjectType quantityTypeForIdentifier: HKQuantityTypeIdentifierFlightsClimbed];
392
392
393
393
[self fetchSumOfSamplesOnDayForType: quantityType unit: unit includeManuallyAdded: includeManuallyAdded day: date completion: ^(double count, NSDate *startDate, NSDate *endDate, NSError *error) {
394
- if (!count && count != 0 ) {
394
+ if (( !count && count != 0 ) || error != nil ) {
395
395
callback (@[RCTJSErrorFromNSError (error)]);
396
396
return ;
397
397
}
0 commit comments