Fix a couple undefined variable errors

getVariable will only return the default value specified if the object is defined. If the object is undefined it will return "any": https://community.bistudio.com/wiki/getVariable

So, it is necessary to check if the return value is nil before using it. These errors apparently went unnoticed before, but are now being reported in server RPT on arma 1.63.112555+