diff options
author | Manuel Bentele | 2021-07-01 11:30:18 +0200 |
---|---|---|
committer | Manuel Bentele | 2021-07-01 11:30:18 +0200 |
commit | a19ba3c3209624acd0ed66613d6394945f58d8e8 (patch) | |
tree | afbb93be69a9e6bd6e163b04acc1f7985bc96d8e /core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/plugin/qemu/App.java | |
parent | [qemu] Enable Java compiler warnings (diff) | |
download | mltk-a19ba3c3209624acd0ed66613d6394945f58d8e8.tar.gz mltk-a19ba3c3209624acd0ed66613d6394945f58d8e8.tar.xz mltk-a19ba3c3209624acd0ed66613d6394945f58d8e8.zip |
[qemu] Handle 'NullPointerException' if config filenames are missing
Diffstat (limited to 'core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/plugin/qemu/App.java')
-rw-r--r-- | core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/plugin/qemu/App.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/plugin/qemu/App.java b/core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/plugin/qemu/App.java index 5ea7b720..c9d47f5e 100644 --- a/core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/plugin/qemu/App.java +++ b/core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/plugin/qemu/App.java @@ -113,7 +113,8 @@ public class App try { final File xmlInputFile = new File( xmlInputFileName ); config = new Domain( xmlInputFile ); - } catch ( LibvirtXmlDocumentException | LibvirtXmlSerializationException | LibvirtXmlValidationException e ) { + } catch ( NullPointerException | LibvirtXmlDocumentException | LibvirtXmlSerializationException + | LibvirtXmlValidationException e ) { LOGGER.error( "Failed to read VM input configuration file: " + e.getLocalizedMessage() ); hypervisor.close(); System.exit( 3 ); @@ -159,7 +160,7 @@ public class App try { final File xmlOutputFile = new File( xmlOutputFileName ); config.toXml( xmlOutputFile ); - } catch ( LibvirtXmlSerializationException e ) { + } catch ( NullPointerException | LibvirtXmlSerializationException e ) { LOGGER.error( "Failed to write VM output configuration file: " + e.getLocalizedMessage() ); hypervisor.close(); System.exit( 5 ); |