Add variable to null check when importing OVF files from web server

Also modify `int` into `var`

Signed-off-by: Danilo Del Busso <Danilo.Del.Busso@citrix.com>
This commit is contained in:
Danilo Del Busso 2021-09-16 10:02:06 +01:00 committed by Konstantina Chremmou
parent 46b83bf3a4
commit 32571300bb

View File

@ -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)
{