diff --git a/modules/org.openbravo.service.integration.google/src/org/openbravo/service/integration/google/GoogleAuthServlet.java b/modules/org.openbravo.service.integration.google/src/org/openbravo/service/integration/google/GoogleAuthServlet.java
--- a/modules/org.openbravo.service.integration.google/src/org/openbravo/service/integration/google/GoogleAuthServlet.java
+++ b/modules/org.openbravo.service.integration.google/src/org/openbravo/service/integration/google/GoogleAuthServlet.java
@@ -142,7 +142,7 @@
 
       User user = OpenIDManager.getInstance().getUser(oid);
 
-      if (user == null) {
+      if (user == null && oid != null) {
         user = createUser(oid, req, resp);
         if (user == null) {
           return;
@@ -151,10 +151,12 @@
 
       req.getSession(true).removeAttribute("#Authenticated_user");
 
-      String sessionId = createDBSession(req, user.getUsername(), user.getId());
-      req.getSession(true).setAttribute("#Authenticated_user", user.getId());
-      vars.setSessionValue("#AD_SESSION_ID", sessionId);
-      vars.setSessionValue("#LOGGINGIN", "Y");
+      if (user != null) {
+        String sessionId = createDBSession(req, user.getUsername(), user.getId());
+        req.getSession(true).setAttribute("#Authenticated_user", user.getId());
+        vars.setSessionValue("#AD_SESSION_ID", sessionId);
+        vars.setSessionValue("#LOGGINGIN", "Y");
+      }
 
       resp.sendRedirect(strDireccion + "/security/Menu.html");
 
diff --git a/modules/org.openbravo.service.integration.openid/src/org/openbravo/service/integration/openid/OpenIDManager.java b/modules/org.openbravo.service.integration.openid/src/org/openbravo/service/integration/openid/OpenIDManager.java
--- a/modules/org.openbravo.service.integration.openid/src/org/openbravo/service/integration/openid/OpenIDManager.java
+++ b/modules/org.openbravo.service.integration.openid/src/org/openbravo/service/integration/openid/OpenIDManager.java
@@ -136,6 +136,11 @@
   public User getUser(Identifier oid) throws OBException {
     User u = null;
 
+    if (oid == null) {
+      log.error("No user has been associated with the Google account");
+      return null;
+    }
+
     OBCriteria<OBSOIDUserIdentifier> userCriteria = OBDal.getInstance().createCriteria(
         OBSOIDUserIdentifier.class);
     userCriteria
