changeset 108:bcc9e98bb725 dev

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 28 Apr 2016 09:14:06 +0200
parents fea72403194b
children 04fbfd59a60e
files Plugin/StowRsClient.cpp
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Plugin/StowRsClient.cpp	Wed Apr 27 17:24:23 2016 +0200
+++ b/Plugin/StowRsClient.cpp	Thu Apr 28 09:14:06 2016 +0200
@@ -197,6 +197,10 @@
     }
 
     std::string resource = resources[i].asString();
+    if (resource.empty())
+    {
+      throw Orthanc::OrthancException(Orthanc::ErrorCode_UnknownResource);
+    }
 
     Json::Value tmp;
     if (OrthancPlugins::RestApiGetJson(tmp, context_, "/instances/" + resource, false))
@@ -222,7 +226,6 @@
     }
     else
     {
-      // Unkown resource
       throw Orthanc::OrthancException(Orthanc::ErrorCode_UnknownResource);
     }   
   }
@@ -316,4 +319,7 @@
   }
 
   SendStowChunks(peer, mime, boundary, chunks, countInstances, true);
+
+  std::string answer = "{}\n";
+  OrthancPluginAnswerBuffer(context_, output, answer.c_str(), answer.size(), "application/json");
 }