From 6ade66243aba2942f4833433cb13adee48d6e93a Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 18 Oct 2014 14:42:25 +0200 Subject: [PATCH] Treat non-existing list of bots as an offer of 0 packs. --- src/main/java/net/pterodactylus/xdcc/core/Core.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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() -- 2.7.4