Cannot index into a null Array Error
bellicose100xp opened this issue · 1 comments
bellicose100xp commented
I'm getting this error for Apple Airport Extreme Router.
Cannot index into a null array.
At
C:\Users\admin\Desktop\PowerShell_AsyncIPv4Scanner-master\PowerShell_AsyncIPv4Scanner-master\Scripts\New-IPv4Scan.ps1:399
char:17
- ... $Vendor = (($MAC_VendorList | Where-Object {$_.Assignment ...
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~- CategoryInfo : InvalidOperation: (:) [], RuntimeException
- FullyQualifiedErrorId : NullArray
BornToBeRoot commented
@bellicose100xp That happens when the MAC-Address is not in the official Vendor List... I try to assign the first entry in the list which matches the MAC-Address.
This should fix it:
try {
$Vendor = (($MAC_VendorList | Where-Object {$_.Assignment -eq $MACVendor_Search})[0])."Organization Name"
}
catch {}New version including this fix is released:
https://github.com/BornToBeRoot/PowerShell_AsyncIPv4Scanner/releases/latest