mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 04:58:45 +00:00
Attempt to address a search crash.
This commit is contained in:
committed by
Cody Henthorne
parent
71b5645801
commit
098da3c3dd
@@ -1,10 +1,14 @@
|
||||
package org.thoughtcrime.securesms.util;
|
||||
|
||||
import android.database.sqlite.SQLiteDatabaseCorruptException;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.signal.core.util.ExceptionUtil;
|
||||
import org.signal.core.util.logging.Log;
|
||||
import org.thoughtcrime.securesms.database.LogDatabase;
|
||||
import org.thoughtcrime.securesms.database.SearchTable;
|
||||
import org.thoughtcrime.securesms.database.SignalDatabase;
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
|
||||
@@ -36,6 +40,15 @@ public class SignalUncaughtExceptionHandler implements Thread.UncaughtExceptionH
|
||||
return;
|
||||
}
|
||||
|
||||
if (e instanceof SQLiteDatabaseCorruptException) {
|
||||
if (e.getMessage().indexOf("message_fts") >= 0) {
|
||||
Log.w(TAG, "FTS corrupted! Resetting FTS index.");
|
||||
SignalDatabase.messageSearch().fullyResetTables();
|
||||
} else {
|
||||
Log.w(TAG, "Some non-FTS related corruption?");
|
||||
}
|
||||
}
|
||||
|
||||
if (e instanceof OnErrorNotImplementedException && e.getCause() != null) {
|
||||
e = e.getCause();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user