It's pretty obvious that you get java.lang.IndexOutOfBoundsException
because when the user doesn't exist the query returns an empty list,
but instead of checking whether it's empty you always try to fetch the
first element by doing ".get(0)", thus causing the
IndexOutOfBoundsException.