Fix crash when clientid is invalid