From 25de35dbe0a812134859ba24d5f53a0111e23c00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Tak=C3=A1cs?= <93127072+PeterTakacs300@users.noreply.github.com> Date: Wed, 23 Nov 2022 09:59:37 +0100 Subject: [PATCH] IDEMPIERE-5486 - Advanced Search: Date Fields - NullPointerException (#1576) --- .../org/adempiere/webui/window/FindWindow.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java index 720c6cbd3f..3c3970b671 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java @@ -3282,8 +3282,20 @@ public class FindWindow extends Window implements EventListener, ValueCha if (winMain.getComponent().getSelectedIndex() == 1) { Component component = editor.getComponent(); - listcell = (ListCell)component.getParent(); - listcell.setAttribute("value", evt.getNewValue()); + Component parent = component.getParent(); + if(parent != null) { + if(parent instanceof ListCell) { + listcell = (ListCell) parent; + listcell.setAttribute("value", evt.getNewValue()); + } + else { // use case: Date To editor with Date Range Button + Component secondParent = parent.getParent(); + if(secondParent instanceof ListCell) { + listcell = (ListCell) secondParent; + listcell.setAttribute("value", evt.getNewValue()); + } + } + } ctx = m_advanceCtx; } else