Prevent null reference when importing OVF files from web server

Signed-off-by: Danilo Del Busso <Danilo.Del.Busso@citrix.com>
This commit is contained in:
Danilo Del Busso 2021-09-09 11:35:02 +01:00 committed by Konstantina Chremmou
parent 7d9bbbc68b
commit 46b83bf3a4

View File

@ -754,6 +754,8 @@ namespace XenAdmin.Wizards.ImportWizard
int index = _uri.OriginalString.LastIndexOf('/') + 1; int index = _uri.OriginalString.LastIndexOf('/') + 1;
var remoteDir = _uri.OriginalString.Substring(0, index); var remoteDir = _uri.OriginalString.Substring(0, index);
if (envType.References.File != null)
{
foreach (var file in envType.References.File) foreach (var file in envType.References.File)
{ {
var remoteUri = new Uri(remoteDir + file.href); var remoteUri = new Uri(remoteDir + file.href);
@ -762,6 +764,7 @@ namespace XenAdmin.Wizards.ImportWizard
} }
} }
} }
}
if (_filesToDownload.Count == 0) if (_filesToDownload.Count == 0)
{ {