Add guards around arguments being null
Add guards around arguments being null

Fixes vscode-cpptools/#3532

Microsoft/MIEngine,orbitcowboy/MIEngine,Microsoft/MIEngine,orbitcowboy/MIEngine,Microsoft/MIEngine,orbitcowboy/MIEngine,Microsoft/MIEngine,orbitcowboy/MIEngine