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

[Ovirt-devel] [PATCH] small bug fix, the include_vm variable is null when passed in from vm_controller.create



---
 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..4044a13 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 && include_vm.id)
       self.find(:all, :include => [:vms, :storage_pool], :conditions => condition)
     else
       return []
-- 
1.5.4.1


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