Skip to content

Commit 2ea8f5f

Browse files
committed
nil check for active period
1 parent 5b0d2e8 commit 2ea8f5f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Leanplum-SDK/Classes/LPActionManager.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1094,7 +1094,11 @@ - (LeanplumMessageMatchResult)shouldShowMessage:(NSString *)messageId
10941094
NSTimeInterval now = [[NSDate date] timeIntervalSince1970];
10951095
NSTimeInterval startTime = [messageConfig[@"startTime"] doubleValue] / 1000.0;
10961096
NSTimeInterval endTime = [messageConfig[@"endTime"] doubleValue] / 1000.0;
1097-
result.matchedActivePeriod = now > startTime && now < endTime;
1097+
if (startTime && endTime) {
1098+
result.matchedActivePeriod = now > startTime && now < endTime;
1099+
} else {
1100+
result.matchedActivePeriod = YES;
1101+
}
10981102

10991103
return result;
11001104
}

0 commit comments

Comments
 (0)