Add missing UserManager check

Caused an java.lang.IndexOutOfBoundsException: Index: 0

Fixes #2335