mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-06-05 17:00:23 +02:00
add some null checks at getting current text
This commit is contained in:
@ -214,7 +214,8 @@ class MainActivity : SimpleActivity(), ViewPager.OnPageChangeListener {
|
||||
|
||||
private fun exportAsFile() {
|
||||
ExportAsDialog(this, mCurrentNote) {
|
||||
exportNoteValueToFile(it, getCurrentNoteText())
|
||||
if (getCurrentNoteText()?.isNotEmpty() == true)
|
||||
exportNoteValueToFile(it, getCurrentNoteText()!!)
|
||||
}
|
||||
}
|
||||
|
||||
@ -307,7 +308,7 @@ class MainActivity : SimpleActivity(), ViewPager.OnPageChangeListener {
|
||||
|
||||
private fun shareText() {
|
||||
val text = getCurrentNoteText()
|
||||
if (text.isEmpty()) {
|
||||
if (text == null || text.isEmpty()) {
|
||||
toast(R.string.cannot_share_empty_text)
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user