guarding against null call to fix Code Analysis error

I think I introduced the error with 9ad8237ff2b946e1b2588d932ab2d2ab5bd9d067.
:blush: