Skip to content

Commit d7da0e6

Browse files
committed
Fix crash when store list is not provided
Previously, the SDK expected storeList to be set by integrators and would crash if only directDownloadList was provided. This fix ensures the SDK only crashes when both storeList and directDownloadList are missing.
1 parent fca8bcb commit d7da0e6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

appupdater/src/main/java/com/pouyaheydari/appupdater/main/ui/AppUpdaterDialog.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ class AppUpdaterDialog : DialogFragment() {
6161
): View {
6262
// Getting data passed to the library
6363
val data = arguments?.parcelable(UPDATE_DIALOG_KEY) ?: UpdaterFragmentModel.EMPTY
64-
if (data == UpdaterFragmentModel.EMPTY || data.storeList.isEmpty()) {
65-
throw IllegalArgumentException("It seems you forgot to add any data to the updater dialog. Add the data as described in $UPDATE_DIALOG_README_URL")
64+
if (data == UpdaterFragmentModel.EMPTY || (data.storeList.isEmpty() && data.directDownloadList.isEmpty())) {
65+
throw IllegalArgumentException("Invalid data provided to the updater dialog. Either 'storeList' or 'directDownloadList' must be non-empty. For more details, refer to the documentation at $UPDATE_DIALOG_README_URL")
6666
}
6767
setDialogBackground(mapToSelectedTheme(data.theme, requireContext()))
6868
isCancelable = data.isForceUpdate

0 commit comments

Comments
 (0)