From: Fredrik Tolf Date: Wed, 16 Feb 2022 18:25:21 +0000 (+0100) Subject: Fix potential invalid select timeouts. X-Git-Url: http://dolda2000.com/gitweb/?p=jagi.git;a=commitdiff_plain;h=12032480fba70f0521b0ec7ef7bc8db10fc87636 Fix potential invalid select timeouts. --- 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 {