From dec2fa45c543011663cd1724d7e682a4d6a7421d Mon Sep 17 00:00:00 2001
From: fguigues <fguigues@localhost>
Date: Mon, 21 Sep 2009 15:29:04 +0000
Subject: [PATCH] Fix Issue 4240 : NPE in Simplified LDIF view with specific entries   * In the case of a Regex Syntax, there is no name. 

---
 opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/SimplifiedViewEntryPanel.java |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/SimplifiedViewEntryPanel.java b/opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/SimplifiedViewEntryPanel.java
index be8186e..fb08b13 100644
--- a/opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/SimplifiedViewEntryPanel.java
+++ b/opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/SimplifiedViewEntryPanel.java
@@ -1533,9 +1533,12 @@
         AttributeType attr = schema.getAttributeType(attrName.toLowerCase());
         if (attr != null)
         {
-          mustAddBrowseButton =
-            attr.getSyntax().getSyntaxName().equalsIgnoreCase(
+          // There is no name for a regex syntax.
+          String syntaxName = attr.getSyntax().getSyntaxName();
+          if (syntaxName!=null) {
+              mustAddBrowseButton=syntaxName.equalsIgnoreCase(
                 SchemaConstants.SYNTAX_DN_NAME);
+          }
         }
       }
     }

--
Gitblit v1.10.0