Fixes issue 13747: Prevents NPE when changing reference to new selector
authorIván Perdomo <ivan.perdomo@openbravo.com>
Thu, 24 Jun 2010 09:58:01 +0200
changeset 7708 92c5a224fb80
parent 7707 04159e101f97
child 7709 effc222a5857
Fixes issue 13747: Prevents NPE when changing reference to new selector
The NPE happens on fields of child tabs and are associated with the column
marked as 'link to parent'. Changed the way to check for value 'Y' to prevent
the NPE.
src-wad/src/org/openbravo/wad/controls/WADControl.java
--- a/src-wad/src/org/openbravo/wad/controls/WADControl.java	Wed Jun 23 20:59:54 2010 +0530
+++ b/src-wad/src/org/openbravo/wad/controls/WADControl.java	Thu Jun 24 09:58:01 2010 +0200
@@ -374,7 +374,7 @@
     StringBuffer texto = new StringBuffer();
     int ilist = Integer.valueOf(vecCounters.elementAt(1).toString()).intValue();
     int itable = Integer.valueOf(vecCounters.elementAt(0).toString()).intValue();
-    if (field.istranslated.equals("Y")
+    if ("Y".equals(field.istranslated)
         && TableRelationData.existsTableColumn(conn, field.tablename + "_TRL", field.name)) {
       FieldsData fdi[] = FieldsData.tableKeyColumnName(conn, field.tablename);
       if (fdi == null || fdi.length == 0) {