# HG changeset patch # User Sebastien Jodogne # Date 1545294369 -3600 # Node ID 0293cb3d8a37119e86f7cf9f33a847055170fbe5 # Parent 3254b36a5f9b6bce35c12ad57f8a831699408c02 fix for msvc diff -r 3254b36a5f9b -r 0293cb3d8a37 Plugins/Samples/Common/OrthancPluginCppWrapper.cpp --- a/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp Wed Dec 19 14:35:55 2018 +0100 +++ b/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp Thu Dec 20 09:26:09 2018 +0100 @@ -211,13 +211,18 @@ std::vector headersKeys; std::vector headersValues; - for (std::map::const_iterator it = httpHeaders.begin(); it != httpHeaders.end(); it++) + + for (std::map::const_iterator + it = httpHeaders.begin(); it != httpHeaders.end(); it++) { headersKeys.push_back(it->first.c_str()); headersValues.push_back(it->second.c_str()); } - return CheckHttp(OrthancPluginRestApiGet2(GetGlobalContext(), &buffer_, uri.c_str(), httpHeaders.size(), headersKeys.data(), headersValues.data(), applyPlugins)); + return CheckHttp(OrthancPluginRestApiGet2( + GetGlobalContext(), &buffer_, uri.c_str(), httpHeaders.size(), + (headersKeys.empty() ? NULL : &headersKeys[0]), + (headersValues.empty() ? NULL : &headersValues[0]), applyPlugins)); } bool MemoryBuffer::RestApiPost(const std::string& uri,