From a26f603e75859c8086afdd5c8a0d6ba174862639 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Wed, 4 Sep 2013 23:50:02 +0800 Subject: [PATCH] IDEMPIERE-1318 Casting problem on BOM Viewer window. Base on patch from Richard Morales Herrera. --- .../adempiere/webui/component/SimpleTreeModel.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/SimpleTreeModel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/SimpleTreeModel.java index 6c27f640fe..fe427a86ed 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/SimpleTreeModel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/SimpleTreeModel.java @@ -159,11 +159,14 @@ public class SimpleTreeModel extends org.zkoss.zul.DefaultTreeModel impl } // Color - final MTreeNode mNode = (MTreeNode) ((DefaultTreeNode) node).getData(); - Color color = mNode.getColor(); - if (color != null){ - String hex = ZkCssHelper.createHexColorString(color); - ZkCssHelper.appendStyle(tc, "color: #" + hex); + Object data = ((DefaultTreeNode) node).getData(); + if (data instanceof MTreeNode) { + final MTreeNode mNode = (MTreeNode) data; + Color color = mNode.getColor(); + if (color != null){ + String hex = ZkCssHelper.createHexColorString(color); + ZkCssHelper.appendStyle(tc, "color: #" + hex); + } } // End color }else{