Added null check for BaseObject
Added null check for BaseObject

dlwyatt/PSScriptAnalyzer,juneb/PSScriptAnalyzer,korygill/PSScriptAnalyzer,PowerShell/PSScriptAnalyzer,daviwil/PSScriptAnalyzer,rkeithhill/PSScriptAnalyzer