Mercurial > hg > orthanc-stone
diff Samples/Common/RtViewerApp.cpp @ 1427:cecedf0b1be6
fix for msvc2008
author | s.jodogne@gmail.com |
---|---|
date | Fri, 15 May 2020 14:15:14 +0200 |
parents | 07fac4fdbe07 |
children | dad6a2fe6fc7 |
line wrap: on
line diff
--- a/Samples/Common/RtViewerApp.cpp Fri May 15 13:04:34 2020 +0200 +++ b/Samples/Common/RtViewerApp.cpp Fri May 15 14:15:14 2020 +0200 @@ -227,10 +227,17 @@ arguments_[key] = value; } - const std::string& RtViewerApp::GetArgument(const std::string& key) const + std::string RtViewerApp::GetArgument(const std::string& key) const { - ORTHANC_ASSERT(HasArgument(key)); - return arguments_.at(key); + std::map<std::string, std::string>::const_iterator found = arguments_.find(key); + if (found == arguments_.end()) + { + throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); + } + else + { + return found->second; + } } bool RtViewerApp::HasArgument(const std::string& key) const