[jsword-svn] r1936 - trunk/jsword/src/main/java/org/crosswire/jsword/book/sword

dmsmith at crosswire.org dmsmith at crosswire.org
Tue Feb 24 06:44:36 MST 2009


Author: dmsmith
Date: 2009-02-24 06:44:36 -0700 (Tue, 24 Feb 2009)
New Revision: 1936

Modified:
   trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/DataEntry.java
Log:
Fixed a dictionary bug when checking empty entries for whether it is a link.

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/DataEntry.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/DataEntry.java	2009-02-24 12:57:51 UTC (rev 1935)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/DataEntry.java	2009-02-24 13:44:36 UTC (rev 1936)
@@ -95,8 +95,12 @@
      */
     public boolean isLinkEntry()
     {
-        String linkCheck = SwordUtil.decode(name, data, getKeyEnd() + 1, 5, charset);
-        return "@LINK".equals(linkCheck); //$NON-NLS-1$
+        if (data.length >= 5)
+        {
+            String linkCheck = SwordUtil.decode(name, data, getKeyEnd() + 1, 5, charset);
+            return "@LINK".equals(linkCheck); //$NON-NLS-1$
+        }
+        return false;
     }
 
     /**




More information about the jsword-svn mailing list