Add check if returned value is reference type and null