Skip to content

Commit

Permalink
refactor(capture-sdk): Throw an exception when creating `GiniCaptureF…
Browse files Browse the repository at this point in the history
…ragment` but `GiniCapture` instance is missing

BSDK-258
  • Loading branch information
a-szotyori committed Jan 23, 2024
1 parent f68c634 commit dfc8744
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -683,10 +683,16 @@ public EntryPoint getEntryPoint() {


public static GiniCaptureFragment createGiniCaptureFragment() {
if (!GiniCapture.hasInstance()) {
throw new IllegalStateException("GiniCapture instance was created. Call GiniCapture.newInstance() before creating the GiniCaptureFragment.");
}
return GiniCaptureFragment.createInstance(null);
}

public CancellationToken createGiniCaptureFragmentForIntent(Context context, Intent intent, CreateGiniCaptureFragmentForIntentCallback captureIntentCallback) {
if (!GiniCapture.hasInstance()) {
throw new IllegalStateException("GiniCapture instance was created. Call GiniCapture.newInstance() before creating the GiniCaptureFragment.");
}
return createDocumentForImportedFiles(intent, context, new AsyncCallback<Document, ImportedFileValidationException>() {
@Override
public void onSuccess(Document result) {
Expand Down

0 comments on commit dfc8744

Please sign in to comment.