mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-02-02 19:57:15 +01:00
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…
x
Reference in New Issue
Block a user