Add null check for output variable

Seems that he output value can be null and the check therefore is missing