gdelataillade / alarm

A Flutter plugin to easily manage alarms on iOS and Android
https://pub.dev/packages/alarm
MIT License
132 stars 86 forks source link

Fix -> iOS crash when invalid audio url #25

Closed LesYampolskyi closed 1 year ago

LesYampolskyi commented 1 year ago

The purpose of this pull request is to fix ios app crash when you set invalid audio url.

Description: If you set invalid assetAudio link for setAlarm method it handles in try - catch block and calls result(FlutterError.init(...)). But it doesn't stop execution of setAlarm. And at the next unwraping let currentTime = self.audioPlayers[id]!.deviceCurrentTime app crashes.

gdelataillade commented 1 year ago

Hi @LesYampolskyi

Thank you for your interest in the package.

This looks nice. I'll test your code and merge it as soon as possible.