From 17212dc623b5f182f358d5a0e741fb68649500d5 Mon Sep 17 00:00:00 2001 From: juanmont Date: Mon, 29 Oct 2018 14:49:51 +0100 Subject: [PATCH] B #2540: Fixed bug after delete FILES_DS (#2550) (cherry picked from commit fbfbfdca8c7e2d206f7cc8c2cf0551c4cd2eaa29) --- src/vm/VirtualMachine.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/vm/VirtualMachine.cc b/src/vm/VirtualMachine.cc index 54231e501e..4af9e40724 100644 --- a/src/vm/VirtualMachine.cc +++ b/src/vm/VirtualMachine.cc @@ -2788,7 +2788,8 @@ int VirtualMachine::updateconf(VirtualMachineTemplate& tmpl, string &err) } else if ( context_bck != 0 && context_new != 0 ) { - string files_ds = context_bck->vector_value("FILES_DS"); + string files_ds = context_bck->vector_value("FILES_DS"); + string files_ds_new = context_new->vector_value("FILES_DS"); context_new = context_new->clone(); context_new->remove("FILES_DS"); @@ -2809,7 +2810,7 @@ int VirtualMachine::updateconf(VirtualMachineTemplate& tmpl, string &err) context_new = obj_template->get("CONTEXT"); - if ( !files_ds.empty() ) + if ( !files_ds.empty() && !files_ds_new.empty()) { context_new->replace("FILES_DS", files_ds); }