From 17bb00c042dda46490debc4dcd507a57fe4d5987 Mon Sep 17 00:00:00 2001 From: Steven Siloti Date: Sun, 14 May 2017 17:09:45 -0700 Subject: [PATCH] add missing checks for best_ae being valid --- examples/client_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/client_test.cpp b/examples/client_test.cpp index 3e681ba13..cc27e079e 100644 --- a/examples/client_test.cpp +++ b/examples/client_test.cpp @@ -1719,8 +1719,8 @@ COLUMN OPTIONS std::snprintf(str, sizeof(str), "%2d %-55s fails: %-3d (%-3d) %s %s %5d \"%s\" %s\x1b[K\n" , ae.tier, ae.url.c_str() , best_ae != ae.endpoints.end() ? best_ae->fails : 0, ae.fail_limit, ae.verified?"OK ":"- " - , to_string(int(total_seconds(best_ae->next_announce - now)), 8).c_str() - , int(best_ae->min_announce > now ? total_seconds(best_ae->min_announce - now) : 0) + , to_string(best_ae != ae.endpoints.end() ? int(total_seconds(best_ae->next_announce - now)) : 0, 8).c_str() + , best_ae != ae.endpoints.end() && best_ae->min_announce > now ? int(total_seconds(best_ae->min_announce - now)) : 0 , best_ae != ae.endpoints.end() && best_ae->last_error ? best_ae->last_error.message().c_str() : "" , best_ae != ae.endpoints.end() ? best_ae->message.c_str() : ""); out += str;