refs #7043 do not cast a null value in userId to string as it would result in a string null, check whether it exists instead