diff --git a/Tunnel.cpp b/Tunnel.cpp index 88e7a70a..cd05d9aa 100644 --- a/Tunnel.cpp +++ b/Tunnel.cpp @@ -278,7 +278,7 @@ namespace tunnel tunnel = it; i++; } - if (i >= ind) break; + if (i > ind && tunnel) break; } return tunnel; } diff --git a/TunnelPool.cpp b/TunnelPool.cpp index 2f4a4f12..f480b7d8 100644 --- a/TunnelPool.cpp +++ b/TunnelPool.cpp @@ -102,7 +102,7 @@ namespace tunnel tunnel = it; i++; } - if (i >= ind) break; + if (i > ind && tunnel) break; } return tunnel; }