Assert basePaths was not null
This commit is contained in:
parent
c78732d226
commit
c58c7d3543
1 changed files with 10 additions and 0 deletions
|
@ -57,6 +57,11 @@ namespace System.Management.Automation
|
||||||
internal PowerShellAssemblyLoadContext(string basePaths)
|
internal PowerShellAssemblyLoadContext(string basePaths)
|
||||||
{
|
{
|
||||||
#region Validation
|
#region Validation
|
||||||
|
if (string.IsNullOrEmpty(basePaths))
|
||||||
|
{
|
||||||
|
throw new ArgumentNullException("basePaths");
|
||||||
|
}
|
||||||
|
|
||||||
this.basePaths = basePaths.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
|
this.basePaths = basePaths.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
|
||||||
for (int i = 0; i < this.basePaths.Length; i++)
|
for (int i = 0; i < this.basePaths.Length; i++)
|
||||||
{
|
{
|
||||||
|
@ -606,6 +611,11 @@ namespace System.Management.Automation
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void SetPowerShellAssemblyLoadContext([MarshalAs(stringType)]string basePaths)
|
public static void SetPowerShellAssemblyLoadContext([MarshalAs(stringType)]string basePaths)
|
||||||
{
|
{
|
||||||
|
if (string.IsNullOrEmpty(basePaths))
|
||||||
|
{
|
||||||
|
throw new ArgumentNullException("basePaths");
|
||||||
|
}
|
||||||
|
|
||||||
if (PSAsmLoadContext == null)
|
if (PSAsmLoadContext == null)
|
||||||
{
|
{
|
||||||
PSAsmLoadContext = new PowerShellAssemblyLoadContext(basePaths);
|
PSAsmLoadContext = new PowerShellAssemblyLoadContext(basePaths);
|
||||||
|
|
Loading…
Reference in a new issue