Skip to content

Commit b8e87e4

Browse files
anodCopilot
andauthored
Update lib/android_build/maesdk/src/main/java/com/microsoft/applications/events/OfflineRoom.java
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent c593c22 commit b8e87e4

File tree

1 file changed

+15
-10
lines changed
  • lib/android_build/maesdk/src/main/java/com/microsoft/applications/events

1 file changed

+15
-10
lines changed

lib/android_build/maesdk/src/main/java/com/microsoft/applications/events/OfflineRoom.java

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -290,17 +290,22 @@ public void deleteSetting(String name) {
290290

291291
private void initPageSize() {
292292
if (m_pageSize == -1) {
293-
try (Cursor c = m_db.query("PRAGMA page_size", null)) {
294-
if (c.getCount() == 1 && c.getColumnCount() == 1) {
295-
c.moveToFirst();
296-
m_pageSize = c.getLong(0);
297-
} else {
298-
m_pageSize = PAGE_SIZE_DEFAULT;
299-
Log.e("MAE",
300-
String.format("Unexpected result from PRAGMA page_size: %d rows, %d columns",
301-
c.getCount(),
302-
c.getColumnCount()));
293+
try {
294+
try (Cursor c = m_db.query("PRAGMA page_size", null)) {
295+
if (c.getCount() == 1 && c.getColumnCount() == 1) {
296+
c.moveToFirst();
297+
m_pageSize = c.getLong(0);
298+
} else {
299+
m_pageSize = PAGE_SIZE_DEFAULT;
300+
Log.e("MAE",
301+
String.format("Unexpected result from PRAGMA page_size: %d rows, %d columns",
302+
c.getCount(),
303+
c.getColumnCount()));
304+
}
303305
}
306+
} catch (Exception e) {
307+
m_pageSize = PAGE_SIZE_DEFAULT;
308+
Log.e("MAE", "Failed to query PRAGMA page_size, using default page size.", e);
304309
}
305310
}
306311
}

0 commit comments

Comments
 (0)