Fix docs example for custom user data publish

Since the function is always subscribed to, sometimes the userId would be null, and I think it would be good practice to not invoke a db query you know won't return anything?