Fix a crash when opening the "Import from app" dialog

This commit is contained in:
Alexander Bakker 2021-05-07 18:08:16 +02:00
parent 0a9bfde438
commit e319a2eceb

View file

@ -402,7 +402,10 @@ public class Dialogs {
List<DatabaseImporter.Definition> importers = DatabaseImporter.getImporters(isDirect);
List<String> names = importers.stream().map(DatabaseImporter.Definition::getName).collect(Collectors.toList());
int i = names.indexOf(context.getString(R.string.app_name));
int i = 0;
if (!isDirect) {
i = names.indexOf(context.getString(R.string.app_name));
}
View view = LayoutInflater.from(context).inflate(R.layout.dialog_importers, null);
TextView helpText = view.findViewById(R.id.text_importer_help);
setImporterHelpText(helpText, importers.get(i), isDirect);