From: David ‘Bombe’ Roden Date: Sat, 18 Oct 2014 12:42:25 +0000 (+0200) Subject: Treat non-existing list of bots as an offer of 0 packs. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=6ade66243aba2942f4833433cb13adee48d6e93a;p=xudocci.git Treat non-existing list of bots as an offer of 0 packs. --- diff --git a/src/main/java/net/pterodactylus/xdcc/core/Core.java b/src/main/java/net/pterodactylus/xdcc/core/Core.java index 272076c..b6fb400 100644 --- a/src/main/java/net/pterodactylus/xdcc/core/Core.java +++ b/src/main/java/net/pterodactylus/xdcc/core/Core.java @@ -184,7 +184,7 @@ public class Core extends AbstractExecutionThreadService { return networkConnections.entrySet().stream().map((entry) -> { Network network = entry.getKey(); Collection bots = networkBots.row(network).values(); - int packCount = bots.stream().mapToInt((bot) -> bot.packs().size()).reduce((a, b) -> a + b).getAsInt(); + int packCount = bots.stream().mapToInt((bot) -> bot.packs().size()).reduce((a, b) -> a + b).orElse(0); return new ConnectedNetwork(network, entry.getValue().hostname(), entry.getValue().port(), entry.getValue().nickname(), channels.stream()