From 32571300bbb0b6a4940bf4f9be524d9bda48ec30 Mon Sep 17 00:00:00 2001 From: Danilo Del Busso Date: Thu, 16 Sep 2021 10:02:06 +0100 Subject: [PATCH] Add variable to null check when importing OVF files from web server Also modify `int` into `var` Signed-off-by: Danilo Del Busso --- XenAdmin/Wizards/ImportWizard/ImportSourcePage.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/XenAdmin/Wizards/ImportWizard/ImportSourcePage.cs b/XenAdmin/Wizards/ImportWizard/ImportSourcePage.cs index ad1f774c2..3816258b0 100644 --- a/XenAdmin/Wizards/ImportWizard/ImportSourcePage.cs +++ b/XenAdmin/Wizards/ImportWizard/ImportSourcePage.cs @@ -751,10 +751,10 @@ namespace XenAdmin.Wizards.ImportWizard if (envType != null) { - int index = _uri.OriginalString.LastIndexOf('/') + 1; + var index = _uri.OriginalString.LastIndexOf('/') + 1; var remoteDir = _uri.OriginalString.Substring(0, index); - if (envType.References.File != null) + if (envType.References?.File != null) { foreach (var file in envType.References.File) {