Fix os/date with nil argument.

This commit is contained in:
Calvin Rose 2022-10-10 15:24:28 -05:00
parent 725c785882
commit 6b27008c99
1 changed files with 1 additions and 1 deletions

View File

@ -1324,7 +1324,7 @@ JANET_CORE_FN(os_date,
time_t t;
struct tm t_infos;
struct tm *t_info = NULL;
if (argc) {
if (argc && !janet_checktype(argv[0], JANET_NIL)) {
int64_t integer = janet_getinteger64(argv, 0);
t = (time_t) integer;
} else {