Skip to content

Commit

Permalink
Merge pull request #572 from gini/PP-814_Error_popup_qrCodeDetection
Browse files Browse the repository at this point in the history
fix: (capture-sdk) Ignore CancellationException
  • Loading branch information
GeraltRiv authored Sep 11, 2024
2 parents bdc6840 + 6cafd16 commit faad8e2
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import net.gini.android.capture.internal.util.Size;

import java.util.List;
import java.util.concurrent.CancellationException;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
Expand Down Expand Up @@ -85,7 +86,9 @@ public void onQRCodesDetected(@NonNull final List<String> qrCodes) {
public void onQRCodeScannerError(Exception e) {

//TODO: check content of exception if there will be more use cases in the future
mListener.onQRCodeReaderFail();
if (!(e instanceof CancellationException)) {
mListener.onQRCodeReaderFail();
}
}
});
}
Expand Down

0 comments on commit faad8e2

Please sign in to comment.