I have a PowerShell code like this
Import-Function Validate-PowerShell
Test-PowerShell
Try
{
$ctx = get-item .
Import-Function Import-RedirectMappings
$file = Receive-File (get-item "master:\media library\Files") -Title "Upload.." -Description "Upload file" -Overwrite
... other code
}
Catch
{
$ErrorRecord=$Error[0]
Write-Log -Log Error $ErrorRecord
Show-Alert "Something went wrong. See SPE logs for more details."
Close-Window
}
in case Receive-File
dialog files is not selected and press ok, user see exception:
[NullReferenceException: Object reference not set to an instance of an object.] Sitecore.UIUtil.GetBrowserClassString() +393
Sitecore.Shell.Controls.Standard.FormPageXmlControl.OnLoad(EventArgs e) +672 System.Web.UI.Control.LoadRecursive() +153
System.Web.UI.Control.LoadRecursive() +250
System.Web.UI.Control.LoadRecursive() +250
System.Web.UI.Control.LoadRecursive() +250
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4081
how it is possible to fix it ?