# HG changeset patch # User Alain Mazy # Date 1747863942 -7200 # Node ID 38c388f7eaed06886a3988b572b318ed8a11f604 # Parent 24bf08f02e55ecb5bd43b281949fda620205685f fix diff -r 24bf08f02e55 -r 38c388f7eaed OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp --- a/OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp Wed May 21 21:31:14 2025 +0200 +++ b/OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp Wed May 21 23:45:42 2025 +0200 @@ -4425,7 +4425,7 @@ { OrthancPluginErrorCode code = OrthancPluginStoreKeyValue(OrthancPlugins::GetGlobalContext(), storeId_.c_str(), key.c_str(), value.c_str(), value.size()); - if (code == OrthancPluginErrorCode_Success) + if (code != OrthancPluginErrorCode_Success) { ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(code); } @@ -4437,16 +4437,16 @@ bool KeyValueStore::GetValue(std::string& value, const std::string& key) { - uint8_t found = false; + uint8_t isExisting = false; OrthancPlugins::MemoryBuffer valueBuffer; - OrthancPluginErrorCode code = OrthancPluginGetKeyValue(OrthancPlugins::GetGlobalContext(), &found, + OrthancPluginErrorCode code = OrthancPluginGetKeyValue(OrthancPlugins::GetGlobalContext(), &isExisting, *valueBuffer, storeId_.c_str(), key.c_str()); if (code != OrthancPluginErrorCode_Success) { ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(code); } - else if (found) + else if (isExisting) { valueBuffer.ToString(value); return true; @@ -4499,17 +4499,17 @@ bool Queue::PopInternal(std::string& value, OrthancPluginQueueOrigin origin) { - uint8_t found = false; + uint8_t isExisting = false; OrthancPlugins::MemoryBuffer valueBuffer; - OrthancPluginErrorCode code = OrthancPluginDequeueValue(OrthancPlugins::GetGlobalContext(), &found, + OrthancPluginErrorCode code = OrthancPluginDequeueValue(OrthancPlugins::GetGlobalContext(), &isExisting, *valueBuffer, queueId_.c_str(), origin); if (code != OrthancPluginErrorCode_Success) { ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(code); } - else if (found) + else if (isExisting) { valueBuffer.ToString(value); return true;