Skip to content

Commit 9150b36

Browse files
committed
fixup! Improve error handling when sleeping
1 parent ba19ad6 commit 9150b36

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/sonyflake_turbo/sonyflake.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,10 @@ static PyObject *sonyflake_sleep(PyObject *obj, struct timespec *to_nanosleep) {
182182
return NULL;
183183
}
184184

185+
if (!to_nanosleep) {
186+
return obj;
187+
}
188+
185189
if (to_nanosleep->tv_sec == 0 && to_nanosleep->tv_nsec == 0) {
186190
return obj;
187191
}

0 commit comments

Comments
 (0)