Details
-
Type: Bug
-
Status: Closed (View Workflow)
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 1.6
-
Fix Version/s: None
-
Component/s: o.c.jsword.book.sword
-
Labels:None
-
Environment:
All
Description
I think there is a bug in GenBookBackend.contains(Key).
The find method will return null if the key is not in the book
TreeNode node = find(key);
which means the next line will throw a NullPointerException
byte[] userData = node.getUserData();
Here is the whole method:
@Override
public boolean contains(Key key) {
checkActive();
try
{ DataPolice.setKey(key); TreeNode node = find(key); byte[] userData = node.getUserData(); // Some entries may be empty. return userData.length == 8; }catch (IOException e)
{ return false; }finally
{ DataPolice.setKey(null); }}