diff --git a/maxscale-system-test/local_address.cpp b/maxscale-system-test/local_address.cpp index 442876daf..071f43374 100644 --- a/maxscale-system-test/local_address.cpp +++ b/maxscale-system-test/local_address.cpp @@ -78,7 +78,13 @@ void get_maxscale_ips(TestConnections& test, vector* pIps) to_collection(output, "\n", pIps); transform(pIps->begin(), pIps->end(), pIps->begin(), extract_ip); - pIps->erase(find(pIps->begin(), pIps->end(), "127.0.0.1")); + // Remove 127.0.0.1 if it is present. + auto i = find(pIps->begin(), pIps->end(), "127.0.0.1"); + + if (i != pIps->end()) + { + pIps->erase(i); + } } }