@@ -203,7 +203,7 @@ class MainActivity : SimpleActivity() {
203203 val file = File (realPath)
204204 handleUri(Uri .fromFile(file))
205205 } else {
206- handleUri(data)
206+ handleUri(data!! )
207207 }
208208 intent.removeCategory(Intent .CATEGORY_DEFAULT )
209209 intent.action = null
@@ -239,7 +239,7 @@ class MainActivity : SimpleActivity() {
239239 }
240240
241241 private fun handleUri (uri : Uri ) {
242- NotesHelper (this ).getNoteIdWithPath(uri.path) {
242+ NotesHelper (this ).getNoteIdWithPath(uri.path!! ) {
243243 if (it != null && it > 0L ) {
244244 updateSelectedNote(it)
245245 return @getNoteIdWithPath
@@ -397,7 +397,7 @@ class MainActivity : SimpleActivity() {
397397
398398 private fun importUri (uri : Uri ) {
399399 when (uri.scheme) {
400- " file" -> openPath(uri.path)
400+ " file" -> openPath(uri.path!! )
401401 " content" -> {
402402 val realPath = getRealPathFromURI(uri)
403403 if (realPath != null ) {
@@ -578,12 +578,13 @@ class MainActivity : SimpleActivity() {
578578 parent.createFile(" " , path.getFilenameFromPath())!!
579579 }
580580
581- contentResolver.openOutputStream(document.uri).apply {
581+ contentResolver.openOutputStream(document.uri)!! .apply {
582582 val byteArray = content.toByteArray(Charset .forName(" UTF-8" ))
583583 write(byteArray, 0 , byteArray.size)
584584 flush()
585585 close()
586586 }
587+
587588 if (showSuccessToasts) {
588589 noteExportedSuccessfully(path.getFilenameFromPath())
589590 }
0 commit comments