check null file output stream at exporting events
This commit is contained in:
parent
ec5dd1c852
commit
0cc94f8e02
|
@ -19,6 +19,11 @@ class IcsExporter {
|
|||
|
||||
fun exportEvents(activity: SimpleActivity, file: File, events: ArrayList<Event>, callback: (result: ExportResult) -> Unit) {
|
||||
activity.getFileOutputStream(file) {
|
||||
if (it == null) {
|
||||
callback(EXPORT_FAIL)
|
||||
return@getFileOutputStream
|
||||
}
|
||||
|
||||
it.bufferedWriter().use { out ->
|
||||
out.writeLn(BEGIN_CALENDAR)
|
||||
for (event in events) {
|
||||
|
|
Loading…
Reference in New Issue