Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines for 2023.
[simgrid.git] / src / kernel / routing / StarZone.cpp
index a6ef423..ada9bb6 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2022. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2009-2023. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -110,7 +110,7 @@ void StarZone::check_add_route_param(const NetPoint* src, const NetPoint* dst, c
                              src->get_cname(), gw_src->get_cname()));
 
     const auto* netzone_src = get_netzone_recursive(src);
-    if (not netzone_src->is_component_recursive(gw_src))
+    if (not netzone_src || not netzone_src->is_component_recursive(gw_src))
       throw std::invalid_argument(xbt::string_printf(
           "Invalid NetzoneRoute from %s@%s to %s: gw_src %s belongs to %s, not to %s.", src_name, gw_src->get_cname(),
           dst_name, gw_src->get_cname(), gw_src->get_englobing_zone()->get_cname(), src_name));
@@ -126,7 +126,7 @@ void StarZone::check_add_route_param(const NetPoint* src, const NetPoint* dst, c
                              dst->get_cname(), gw_dst->get_cname()));
 
     const auto* netzone_dst = get_netzone_recursive(dst);
-    if (not netzone_dst->is_component_recursive(gw_dst))
+    if (not netzone_dst || not netzone_dst->is_component_recursive(gw_dst))
       throw std::invalid_argument(xbt::string_printf(
           "Invalid NetzoneRoute from %s@%s to %s: gw_dst %s belongs to %s, not to %s.", dst_name, gw_dst->get_cname(),
           src_name, gw_dst->get_cname(), gw_dst->get_englobing_zone()->get_cname(), dst_name));