1
0
mirror of https://github.com/etesync/android synced 2024-12-23 07:08:16 +00:00

Import: replace size check with isEmpty().

This commit is contained in:
Tom Hacohen 2019-05-01 14:31:21 +01:00
parent 6381617f2c
commit f4ce548310

View File

@ -220,7 +220,7 @@ class ImportFragment : DialogFragment() {
val events = Event.fromReader(importReader, null)
importReader.close()
if (events.size == 0) {
if (events.isEmpty()) {
Logger.log.warning("Empty/invalid file.")
result.e = Exception("Empty/invalid file.")
return result
@ -263,7 +263,7 @@ class ImportFragment : DialogFragment() {
val downloader = ContactsSyncManager.ResourceDownloader(context)
val contacts = Contact.fromReader(importReader, downloader)
if (contacts.size == 0) {
if (contacts.isEmpty()) {
Logger.log.warning("Empty/invalid file.")
result.e = Exception("Empty/invalid file.")
return result