summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAgata Olender <agata.olender@intel.com>2020-02-24 13:59:00 +0300
committerDuncan, Terry S <terry.s.duncan@intel.com>2020-02-28 03:05:08 +0300
commit12dd8d9623726c6272f88b56a7dccf76e1304514 (patch)
tree6e03c0e4c44bcb5aaf76c8758c4a136ae5129c83
parent4396a404eaee7e13e01cfbf5467a1d5831c72809 (diff)
downloadvirtual-media-12dd8d9623726c6272f88b56a7dccf76e1304514.tar.xz
Fix for 'Mounting image using legacy mode with invalid credentials
restart VM service'. Due to unsuccessful mounting of image, mount point changes state to ReadyState and perform reset on target object. Target is no longer available so fix assumes adding verification against null value before performing other reset on target fields. Tested manually for scenarios with valid and invalid passwords. Change-Id: I6c9d5f680f76af3c2ba609a7889552345451cf28 Signed-off-by: Agata Olender <agata.olender@intel.com>
-rw-r--r--src/state_machine.hpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/state_machine.hpp b/src/state_machine.hpp
index 6711401..388b79a 100644
--- a/src/state_machine.hpp
+++ b/src/state_machine.hpp
@@ -511,12 +511,18 @@ struct MountPointStateMachine
try
{
auto ret = handleMount(yield, machine);
- machine.target->credentials.reset();
+ if (machine.target)
+ {
+ machine.target->credentials.reset();
+ }
return ret;
}
catch (...)
{
- machine.target->credentials.reset();
+ if (machine.target)
+ {
+ machine.target->credentials.reset();
+ }
throw;
return false;
}