<-- Back

Cannot invoke "com.mendix.basis.session.User.getId()" because "user" is null

Issue

After logging in, the user only sees a blank screen, and the page constantly reloads. When inspecting the application logs, we see the following error. 

java.lang.NullPointerException: Cannot invoke "com.mendix.basis.session.User.getId()" because "user" is null

Environment

Studio Pro 10.9.0 and newer

Cause

The root cause of this issue is changing the System.User.Name after a user logs in and receives an AuthToken. The token value includes the username. When the user name is updated, but the user in the session is not, this behavior occurs.

Solution/Workaround

To resolve this issue, follow these general steps:

  1. Avoid changing the System.User.Name after the user has logged in.
  2. If the username must be updated, make the change to the $currentuser object.

Internal information related

  • 265403
  • RUN-4971
  • CJZ85RLTA/p1763569027177199

Additional information

Not applicable

Have more questions? Submit a request

0 Comments

Article is closed for comments.

To provide feedback, please open a ticket here. Don't forget to include the article's URL along with the feedback you would like to provide.