maritimeconnectivity / IdentityRegistry

MCP (Maritime Connectivity Platform) Identity Registry API
http://maritimeconnectivity.net/#core_components
Apache License 2.0
16 stars 8 forks source link

ArrayIndexOutOfBounds when updating user #1

Closed MadsenJensen closed 8 years ago

MadsenJensen commented 8 years ago

The error might be because of the user already in the DB when I updated the git project and you had added the sync-functionality??? Never the less, it might be a good idea to add a check anyway. I could fix it myself, but I wanted to discuss the reason for the error.

LINE IN CODE: UserRepresentation user = keycloakUserInstance.realm(keycloakBrokerRealm).users().search(username, null, null, null, -1, -1).get(0);

ERROR LOG: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.rangeCheck(Unknown Source) ~[na:1.8.0_77] at java.util.ArrayList.get(Unknown Source) ~[na:1.8.0_77] at net.maritimecloud.identityregistry.utils.KeycloakAdminUtil.updateUser(KeycloakAdminUtil.java:310) ~[classes!/:na] at net.maritimecloud.identityregistry.controllers.UserController.updateUser(UserController.java:168) ~[classes!/:na]