IDEMPIERE-2449 Could not invoke Toolbar listener method: onSave - NPE on GridTab.fireDataStatusChanged

This commit is contained in:
Carlos Ruiz 2015-02-04 10:57:18 -05:00
parent 7338f2958f
commit 62e7adb3bf
1 changed files with 5 additions and 1 deletions

View File

@ -182,7 +182,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
/** A list of event listeners for this component. */
protected EventListenerList m_listenerList = new EventListenerList();
/** Current Data Status Event */
private DataStatusEvent m_DataStatusEvent = null;
private volatile DataStatusEvent m_DataStatusEvent = null;
/** Query */
private MQuery m_query = new MQuery();
private String m_oldQuery = "0=9";
@ -2346,6 +2346,10 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
*/
private void fireDataStatusChanged (DataStatusEvent e)
{
if (e == null) {
log.warning("IDEMPIERE-2449 - event must not arrive null here -> " + Thread.currentThread().getStackTrace());
return; // avoid NPE below
}
DataStatusListener[] listeners = m_listenerList.getListeners(DataStatusListener.class);
if (listeners.length == 0)
return;