From c58c7d3543c718957497509a50ad30b9c956906c Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 24 Jun 2016 16:56:43 -0700 Subject: [PATCH] Assert basePaths was not null --- .../CoreCLR/CorePsAssemblyLoadContext.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/CoreCLR/CorePsAssemblyLoadContext.cs b/src/Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/CoreCLR/CorePsAssemblyLoadContext.cs index cdb88e0a2..4893b9c31 100644 --- a/src/Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/CoreCLR/CorePsAssemblyLoadContext.cs +++ b/src/Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/CoreCLR/CorePsAssemblyLoadContext.cs @@ -57,6 +57,11 @@ namespace System.Management.Automation internal PowerShellAssemblyLoadContext(string basePaths) { #region Validation + if (string.IsNullOrEmpty(basePaths)) + { + throw new ArgumentNullException("basePaths"); + } + this.basePaths = basePaths.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < this.basePaths.Length; i++) { @@ -606,6 +611,11 @@ namespace System.Management.Automation /// public static void SetPowerShellAssemblyLoadContext([MarshalAs(stringType)]string basePaths) { + if (string.IsNullOrEmpty(basePaths)) + { + throw new ArgumentNullException("basePaths"); + } + if (PSAsmLoadContext == null) { PSAsmLoadContext = new PowerShellAssemblyLoadContext(basePaths);