[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Ovirt-devel] [PATCH] Fix case where an id is not passed in.



Signed-off-by: Jason Guiditta <jguiditt redhat com>
---
 wui/src/app/models/storage_volume.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/wui/src/app/models/storage_volume.rb b/wui/src/app/models/storage_volume.rb
index ccc5839..ef9cd6e 100644
--- a/wui/src/app/models/storage_volume.rb
+++ b/wui/src/app/models/storage_volume.rb
@@ -53,7 +53,7 @@ class StorageVolume < ActiveRecord::Base
   def self.find_for_vm(include_vm, vm_pool)
     if vm_pool
       condition =  "(vms.id is null and storage_pools.hardware_pool_id=#{vm_pool.get_hardware_pool.id})"
-      condition += " or vms.id=#{include_vm.id}" if (include_vm.id)
+      condition += " or vms.id=#{include_vm.id}" if (include_vm and include_vm.id)
       self.find(:all, :include => [:vms, :storage_pool], :conditions => condition)
     else
       return []
-- 
1.5.5.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]