Fixed crash when ScribbleView failed to save.

Previously, if an operation failed, we set the result to "null".
However, this was a mistake. Setting the result at all assumes success.
Instead, we need to set an exception so the ListenableFuture knows that
the operation failed.
This commit is contained in:
Greyson Parrelli committed 2018-06-18 14:33:44 -07:00
1 parent e65cd2636b
commit 542e962be9
3 files changed
+8 -2

No files matched your search

@@ -14,6 +14,7 @@ import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.Log;
import android.view.View;
import android.widget.Toast;
import org.thoughtcrime.securesms.PassphraseRequiredActionBarActivity;
import org.thoughtcrime.securesms.R;
@@ -242,6 +243,8 @@ public class ScribbleActivity extends PassphraseRequiredActionBarActivity implem
@Override
public void onFailure(ExecutionException e) {
Log.w(TAG, e);
Toast.makeText(ScribbleActivity.this, R.string.ScribbleActivity_save_failure, Toast.LENGTH_SHORT).show();
finish();
}
});
}