From f8f31b3b677a4807cf0cee536eb4be0279e63ead Mon Sep 17 00:00:00 2001 From: Ben Adrian Sarmiento Date: Fri, 28 Jun 2024 19:55:15 +0200 Subject: [PATCH] Catch nil on error --- pkg/utils/bwlimit.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/utils/bwlimit.go b/pkg/utils/bwlimit.go index 202529b..c444318 100644 --- a/pkg/utils/bwlimit.go +++ b/pkg/utils/bwlimit.go @@ -10,5 +10,5 @@ func IsBytesLimitReached(err error) bool { } func AreAllTokensExpired(err error) bool { - return err.Error() == "all tokens are expired" + return err != nil && err.Error() == "all tokens are expired" }