From a615bfd5e08f079aa3b7241b51f0a8ba4bfd8f43 Mon Sep 17 00:00:00 2001 From: Bartosz Zurkowski Date: Sun, 26 Mar 2017 01:32:48 +0100 Subject: [PATCH] Prevent empty migrations --- src/mas_migration.erl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mas_migration.erl b/src/mas_migration.erl index 7803141..1d920e0 100644 --- a/src/mas_migration.erl +++ b/src/mas_migration.erl @@ -51,11 +51,13 @@ group(Destinations, Agents) -> %%------------------------------------------------------------------------------ %% @private %%------------------------------------------------------------------------------ +send_to_node({_Node, []}) -> ok; send_to_node({Node, Agents}) -> mas_world:migrate_agents(Node, Agents). %%------------------------------------------------------------------------------ %% @private %%------------------------------------------------------------------------------ +send_to_population({_Population, []}) -> ok; send_to_population({Population, Agents}) -> mas_population:add_agents(Population, Agents).