Skip to content

Commit 831cf47

Browse files
committed
handle missing expirytimestamp
1 parent d42d508 commit 831cf47

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docs/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/utils/Time.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default class Time {
4242

4343
static getMillisecondsFromExpiry(expiry: Date): number {
4444
const now = new Date().getTime();
45-
const milliSecondsDistance = expiry.getTime() - now;
45+
const milliSecondsDistance = expiry?.getTime() - now;
4646
return milliSecondsDistance > 0 ? milliSecondsDistance : 0;
4747
}
4848

0 commit comments

Comments
 (0)