Test variable before setting (security)