From 12032480fba70f0521b0ec7ef7bc8db10fc87636 Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Wed, 16 Feb 2022 19:25:21 +0100 Subject: [PATCH] Fix potential invalid select timeouts. --- src/jagi/event/Driver.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jagi/event/Driver.java b/src/jagi/event/Driver.java index 4d23c76..59f54a3 100644 --- a/src/jagi/event/Driver.java +++ b/src/jagi/event/Driver.java @@ -112,7 +112,7 @@ public class Driver { return; } if(first != null) - timeout = (long)Math.ceil((first - now) * 1000); + timeout = Math.max((long)Math.ceil((first - now) * 1000), 0); } poll.selectedKeys().clear(); try { -- 2.11.0