IDEMPIERE-4710 NPE in ProcessInfo.getLastServerRebootDate() (#603)

* Add logging for possible severe issue
This commit is contained in:
Carlos Ruiz 2021-02-23 06:04:39 +01:00 committed by GitHub
parent bd7600fcd9
commit ed68a01c74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 2 deletions

View File

@ -31,6 +31,7 @@ import org.compiere.model.MProcess;
import org.compiere.model.MSession;
import org.compiere.model.PO;
import org.compiere.model.Query;
import org.compiere.util.CLogger;
import org.compiere.util.DisplayType;
import org.compiere.util.Env;
import org.compiere.util.Ini;
@ -50,7 +51,9 @@ public class ProcessInfo implements Serializable
/**
*
*/
private static final long serialVersionUID = -4600747909096993053L;
private static final long serialVersionUID = -4648764346588157872L;
private static final CLogger logger = CLogger.getCLogger(ProcessInfo.class);
/**
* Constructor
@ -920,7 +923,11 @@ public class ProcessInfo implements Serializable
.setOnlyActiveRecords(true)
.first();
return lastServerSession != null ? lastServerSession.getCreated() : null;
if (lastServerSession == null) {
logger.severe("There is no 'Server' record in AD_Session, this can indicate that the server plugin didn't start correctly. Please verify, this can affect scheduled processes, idempiereMonitor, etc.");
return null;
}
return lastServerSession.getCreated();
}
private IProcessUI processUI;