d7laungani / DLLocalNotifications

:speech_balloon: Easily create Local Notifications in swift - Wrapper of UserNotifications Framework
MIT License
214 stars 38 forks source link

Crash when set Date to nil #23

Closed Haraguroicha closed 3 years ago

Haraguroicha commented 5 years ago

Crash at:

https://github.com/d7laungani/DLLocalNotifications/blob/e4e483e13b16af0fb5f65618f6347f0d3aa0bee5/DLLocalNotifications/DLLocalNotifications.swift#L117

by following code

let notification = DLNotification(identifier: "", alertTitle: "", alertBody: "", date: nil, repeats: .none, soundName: "")
let scheduler = DLNotificationScheduler()
scheduler.scheduleNotification(notification: notification)
scheduler.scheduleAllNotifications()
d7laungani commented 4 years ago

Well a notification cannot be scheduled if there is no date set because then it would not know when to set the notification. My question would be what do you want the expected behavior to be?

d7laungani commented 3 years ago

Thank you for reporting. This is now fixed. It is no longer marked as optional.