From 85e775f510198f1d5787695b06fd60a8ceb5c41d Mon Sep 17 00:00:00 2001 From: Eric Harding Date: Thu, 28 Sep 2017 17:04:29 -0400 Subject: [PATCH] Improve error message if replay cannot find the replay file. --- src/lib/utils/HTTPStream.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/utils/HTTPStream.cpp b/src/lib/utils/HTTPStream.cpp index 5db83356e..742136464 100755 --- a/src/lib/utils/HTTPStream.cpp +++ b/src/lib/utils/HTTPStream.cpp @@ -72,8 +72,9 @@ bool download_file_if_newer(const string& host, const string& path, const string tm modtm = boost::initialized_value; const char* rfc_1123_fmt = "%a, %d %b %Y %H:%M:%S %Z"; time_t modified = 0; - if (download.good()) { - stringstream ss(download.headers().at("Last-Modified")); + const std::string last_modified_key = "Last-Modified"; + if (download.good() && download.headers().find(last_modified_key) != download.headers().end()) { + stringstream ss(download.headers().at(last_modified_key)); ss >> std::get_time(&modtm, rfc_1123_fmt); modified = mktime(&modtm); }