Prevent undefined and null logs