Skip to content

Commit 904f7b3

Browse files
authored
Merge pull request #7 from matthieuve/main
Check if expirationDate is really defined
2 parents d7a9328 + 810ae4c commit 904f7b3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/app/core/models/instance.model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ export class Instance {
287287
}
288288

289289
public willExpireInHours(hours: number): boolean {
290-
if (this.expirationDate != null) {
290+
if (this.expirationDate instanceof Date) {
291291
const durationS = (this.expirationDate.getTime() - new Date().getTime());
292292
return durationS < hours * 60 * 60 * 1000;
293293
}

src/app/user/instance-list/card/card.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ export class CardComponent implements OnInit, OnDestroy {
347347
}
348348

349349
private updateExpirationCountdown(): void {
350-
if (this.instance.expirationDate) {
350+
if (this.instance.expirationDate instanceof Date) {
351351
const second = 1000;
352352
const minute = second * 60;
353353
const hour = minute * 60;

0 commit comments

Comments
 (0)