diff --git a/src/main/java/com/seailz/discordjar/DiscordJar.java b/src/main/java/com/seailz/discordjar/DiscordJar.java index 36f921cd..065b9e57 100644 --- a/src/main/java/com/seailz/discordjar/DiscordJar.java +++ b/src/main/java/com/seailz/discordjar/DiscordJar.java @@ -415,7 +415,9 @@ public void removeBucket(Bucket bucket) { public Bucket getBucketForUrl(String url) { final List buckets = new ArrayList<>(this.buckets); for (Bucket bucket : buckets) { - if (bucket.getAffectedRoutes().contains(url)) return bucket; + List affectedRoutes = bucket.getAffectedRoutes(); + if (affectedRoutes == null) continue; + if (affectedRoutes.contains(url)) return bucket; } return null; } diff --git a/src/main/java/com/seailz/discordjar/utils/rest/ratelimit/Bucket.java b/src/main/java/com/seailz/discordjar/utils/rest/ratelimit/Bucket.java index 6e4b3d03..0b86a85d 100644 --- a/src/main/java/com/seailz/discordjar/utils/rest/ratelimit/Bucket.java +++ b/src/main/java/com/seailz/discordjar/utils/rest/ratelimit/Bucket.java @@ -81,6 +81,7 @@ public Bucket addAffectedRoute(String route) { } public List getAffectedRoutes() { + if (affectedRoutes == null) return new ArrayList<>(); return affectedRoutes; }