diff --git a/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditViewModel.kt b/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditViewModel.kt index c56c74527..c023b4d47 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditViewModel.kt @@ -54,7 +54,10 @@ class BookSourceEditViewModel(application: Application) : BaseViewModel(applicat fun pasteSource(onSuccess: (source: BookSource) -> Unit) { execute(context = Dispatchers.Main) { - context.getClipText()?.let { text -> + val text = context.getClipText() + if (text.isNullOrBlank()) { + error("剪贴板为空") + } else { importSource(text, onSuccess) } }.onError {