setIfNull function

Set a variable to a default value if it is NULL