From: marios <[email protected]>

Signed-off-by: marios <[email protected]>
---
 server/lib/cimi/server.rb |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/server/lib/cimi/server.rb b/server/lib/cimi/server.rb
index 77a8d04..2d62c44 100644
--- a/server/lib/cimi/server.rb
+++ b/server/lib/cimi/server.rb
@@ -331,9 +331,13 @@ global_collection :volumes do
     param :id, :string, :required
     control do
       volume = Volume.find(params[:id], self)
-      respond_to do |format|
-        format.xml  { volume.to_xml  }
-        format.json { volume.to_json }
+      if volume
+        respond_to do |format|
+          format.xml  { volume.to_xml  }
+          format.json { volume.to_json }
+        end
+      else
+        report_error(404)
       end
     end
   end
-- 
1.7.6.4

Reply via email to