Skip to content

Commit

Permalink
fix another potential crash. bump version number for 2.3.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedre committed Apr 3, 2013
1 parent f86df75 commit 951a611
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.quran.labs.androidquran" android:versionCode="230"
android:versionName="2.3.0"
package="com.quran.labs.androidquran" android:versionCode="231"
android:versionName="2.3.1"
android:installLocation="auto">

<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="14" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,25 @@ public long getBookmarkId(Integer sura, Integer ayah, int page) {
open();
if (mDb == null){ return -1; }
}

Cursor cursor = mDb.query(BookmarksTable.TABLE_NAME,

Cursor cursor = null;
try {
cursor = mDb.query(BookmarksTable.TABLE_NAME,
null, BookmarksTable.PAGE + "=" + page + " AND " +
BookmarksTable.SURA + (sura == null? " IS NULL" : "=" + sura) +
" AND " + BookmarksTable.AYAH +
(ayah == null?" IS NULL" : "=" + ayah), null, null, null, null);
if (cursor.moveToFirst()){
return cursor.getLong(0);
if (cursor != null && cursor.moveToFirst()){
return cursor.getLong(0);
}
}
catch (Exception e){
// swallow the error for now
}
finally {
if (cursor != null){
try { cursor.close(); } catch (Exception e){ }
}
}
return -1;
}
Expand Down

0 comments on commit 951a611

Please sign in to comment.