gradle
Fix NRE.

Fix race condition on when getUserId is executed.