mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-07 22:15:45 +01:00
fix nullpointerexcpetion on first login
This commit is contained in:
@@ -127,7 +127,7 @@ public class AuthenticationResource
|
|||||||
if ((user != null) &&!SCMContext.USER_ANONYMOUS.equals(user.getName()))
|
if ((user != null) &&!SCMContext.USER_ANONYMOUS.equals(user.getName()))
|
||||||
{
|
{
|
||||||
state = new ScmState(contextProvider, securityContext,
|
state = new ScmState(contextProvider, securityContext,
|
||||||
repositoryManger.getTypes());
|
repositoryManger.getConfiguredTypes());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -161,7 +161,7 @@ public class AuthenticationResource
|
|||||||
if (user != null)
|
if (user != null)
|
||||||
{
|
{
|
||||||
ScmState state = new ScmState(contextProvider, securityContext,
|
ScmState state = new ScmState(contextProvider, securityContext,
|
||||||
repositoryManger.getTypes());
|
repositoryManger.getConfiguredTypes());
|
||||||
|
|
||||||
resp = Response.ok(state).build();
|
resp = Response.ok(state).build();
|
||||||
}
|
}
|
||||||
@@ -199,7 +199,7 @@ public class AuthenticationResource
|
|||||||
}
|
}
|
||||||
|
|
||||||
state = new ScmState(contextProvider, securityContext,
|
state = new ScmState(contextProvider, securityContext,
|
||||||
repositoryManger.getTypes());
|
repositoryManger.getConfiguredTypes());
|
||||||
response = Response.ok(state).build();
|
response = Response.ok(state).build();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -59,6 +59,20 @@ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
|||||||
public class XmlGroupDatabase
|
public class XmlGroupDatabase
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs ...
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public XmlGroupDatabase()
|
||||||
|
{
|
||||||
|
long c = System.currentTimeMillis();
|
||||||
|
|
||||||
|
creationTime = c;
|
||||||
|
lastModified = c;
|
||||||
|
}
|
||||||
|
|
||||||
|
//~--- methods --------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method description
|
* Method description
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -209,7 +209,6 @@ public class XmlGroupManager extends AbstractGroupManager
|
|||||||
if (groupDB == null)
|
if (groupDB == null)
|
||||||
{
|
{
|
||||||
groupDB = new XmlGroupDatabase();
|
groupDB = new XmlGroupDatabase();
|
||||||
groupDB.setCreationTime(System.currentTimeMillis());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -59,6 +59,20 @@ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
|||||||
public class XmlRepositoryDatabase
|
public class XmlRepositoryDatabase
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs ...
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public XmlRepositoryDatabase()
|
||||||
|
{
|
||||||
|
long c = System.currentTimeMillis();
|
||||||
|
|
||||||
|
creationTime = c;
|
||||||
|
lastModified = c;
|
||||||
|
}
|
||||||
|
|
||||||
|
//~--- methods --------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method description
|
* Method description
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -59,6 +59,20 @@ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
|||||||
public class XmlUserDatabase
|
public class XmlUserDatabase
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs ...
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public XmlUserDatabase()
|
||||||
|
{
|
||||||
|
long c = System.currentTimeMillis();
|
||||||
|
|
||||||
|
creationTime = c;
|
||||||
|
lastModified = c;
|
||||||
|
}
|
||||||
|
|
||||||
|
//~--- methods --------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method description
|
* Method description
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -242,7 +242,6 @@ public class XmlUserManager extends AbstractUserManager
|
|||||||
if (userDB == null)
|
if (userDB == null)
|
||||||
{
|
{
|
||||||
userDB = new XmlUserDatabase();
|
userDB = new XmlUserDatabase();
|
||||||
userDB.setCreationTime(System.currentTimeMillis());
|
|
||||||
createDefaultAccounts();
|
createDefaultAccounts();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user