diff --git a/capture-sdk/sdk/src/main/java/net/gini/android/capture/GiniCapture.java b/capture-sdk/sdk/src/main/java/net/gini/android/capture/GiniCapture.java index d82e8ace0e..3b5b1e4be1 100644 --- a/capture-sdk/sdk/src/main/java/net/gini/android/capture/GiniCapture.java +++ b/capture-sdk/sdk/src/main/java/net/gini/android/capture/GiniCapture.java @@ -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() { @Override public void onSuccess(Document result) {