fixing a couple crashes

This commit is contained in:
tibbi
2018-06-19 14:51:19 +02:00
parent dfb31b40a5
commit 170d7438f8
5 changed files with 27 additions and 10 deletions

View File

@ -354,10 +354,14 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
return
}
val inputStream = contentResolver.openInputStream(uri)
val out = FileOutputStream(tempFile)
inputStream.copyTo(out)
showImportContactsDialog(tempFile.absolutePath)
try {
val inputStream = contentResolver.openInputStream(uri)
val out = FileOutputStream(tempFile)
inputStream.copyTo(out)
showImportContactsDialog(tempFile.absolutePath)
} catch (e: Exception) {
showErrorToast(e)
}
}
else -> toast(R.string.invalid_file_format)
}