Fixed a bug that could lead to wrong identification of LSM-BTree point searches.

git-svn-id: https://hyracks.googlecode.com/svn/branches/hyracks_lsm_tree@2928 123451ca-8445-de46-9d55-352943316053
diff --git a/hyracks-storage-am-lsm-btree/src/main/java/edu/uci/ics/hyracks/storage/am/lsm/btree/impls/LSMBTreeSearchCursor.java b/hyracks-storage-am-lsm-btree/src/main/java/edu/uci/ics/hyracks/storage/am/lsm/btree/impls/LSMBTreeSearchCursor.java
index b15b88c..82da312 100644
--- a/hyracks-storage-am-lsm-btree/src/main/java/edu/uci/ics/hyracks/storage/am/lsm/btree/impls/LSMBTreeSearchCursor.java
+++ b/hyracks-storage-am-lsm-btree/src/main/java/edu/uci/ics/hyracks/storage/am/lsm/btree/impls/LSMBTreeSearchCursor.java
@@ -55,8 +55,8 @@
                 if (btreePred.getLowKeyComparator().getKeyFieldCount() == btreePred.getHighKeyComparator()
                         .getKeyFieldCount()) {
                     if (btreePred.getLowKeyComparator().getKeyFieldCount() == lsmInitialState
-                            .getBloomFilterComparator().getKeyFieldCount()) {
-                        if (lsmInitialState.getBloomFilterComparator().compare(btreePred.getLowKey(),
+                            .getOriginalKeyComparator().getKeyFieldCount()) {
+                        if (lsmInitialState.getOriginalKeyComparator().compare(btreePred.getLowKey(),
                                 btreePred.getHighKey()) == 0) {
                             searchType = LSMBTreeSearchType.POINT;
                         }
@@ -89,7 +89,9 @@
 
     @Override
     public void close() throws HyracksDataException {
-        currentCursor.close();
+        if (currentCursor != null) {
+            currentCursor.close();
+        }
     }
 
     @Override