Author: jleroux
Date: Thu Sep 13 23:50:30 2007
New Revision: 575561
URL:
http://svn.apache.org/viewvc?rev=575561&view=revLog:
Applied fix from trunk for revision: 564344
Modified:
ofbiz/branches/release4.0/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java
Modified: ofbiz/branches/release4.0/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java
URL:
http://svn.apache.org/viewvc/ofbiz/branches/release4.0/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java?rev=575561&r1=575560&r2=575561&view=diff==============================================================================
--- ofbiz/branches/release4.0/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java (original)
+++ ofbiz/branches/release4.0/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java Thu Sep 13 23:50:30 2007
@@ -140,6 +140,10 @@
}
public static void setLoggedOut(String userLoginId, GenericDelegator delegator) {
+ if (UtilValidate.isEmpty(userLoginId)) {
+ Debug.logWarning("Called setLogged out with empty userLoginId", module);
+ }
+
Transaction parentTx = null;
boolean beganTransaction = false;
@@ -154,8 +158,12 @@
beganTransaction = TransactionUtil.begin();
GenericValue userLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", userLoginId));
- userLogin.set("hasLoggedOut", "Y");
- userLogin.store();
+ if (userLogin == null) {
+ Debug.logError("Could not find UserLogin record for setLoggedOut with userLoginId [" + userLoginId + "]", module);
+ } else {
+ userLogin.set("hasLoggedOut", "Y");
+ userLogin.store();
+ }
} catch (GenericEntityException e) {
String errMsg = "Unable to set logged out flag on UserLogin";
Debug.logError(e, errMsg, module);