Skip to content

Commit

Permalink
Fix crash when executing search (closes #717)
Browse files Browse the repository at this point in the history
  • Loading branch information
tuomas2 committed Jun 13, 2020
1 parent 0869484 commit 8cfac07
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,13 @@
import android.content.Intent;
import android.util.Log;

import net.bible.android.SharedConstants;
import net.bible.android.activity.R;
import net.bible.android.control.ApplicationScope;
import net.bible.android.control.navigation.DocumentBibleBooksFactory;
import net.bible.android.control.page.CurrentBiblePage;
import net.bible.android.control.page.PageControl;
import net.bible.android.control.page.window.ActiveWindowPageManagerProvider;
import net.bible.android.control.versification.Scripture;
import net.bible.android.view.activity.base.CurrentActivityHolder;
import net.bible.android.view.activity.base.Dialogs;
import net.bible.android.view.activity.search.Search;
import net.bible.android.view.activity.search.SearchIndex;
import net.bible.service.common.CommonUtils;
Expand Down Expand Up @@ -168,7 +165,12 @@ public SearchResultsDto getSearchResults(String document, String searchText) thr

// search the current book
Book book = swordDocumentFacade.getDocumentByInitials(document);
Key result = swordContentFacade.search(book, searchText);
Key result = null;
try {
result = swordContentFacade.search(book, searchText);
} catch (BookException e) {
Log.e(TAG, "Error in executing search: " + searchText);
}
if (result!=null) {
int resNum = result.getCardinality();
Log.d(TAG, "Number of results:"+resNum);
Expand Down

0 comments on commit 8cfac07

Please sign in to comment.