ソースを参照

Fixed crashing `get` if notification doesn't exist

Sebastián Katzer 10 年 前
コミット
2d4033c32d
2 ファイル変更4 行追加1 行削除
  1. 3 0
      CHANGELOG.md
  2. 1 1
      src/ios/APPLocalNotification.m

+ 3 - 0
CHANGELOG.md

@@ -3,6 +3,9 @@ ChangeLog
 
 Please also read the [Upgrade Guide](https://github.com/katzer/cordova-plugin-local-notifications/wiki/Upgrade-Guide) for more information.
 
+#### Version 0.8.3 (not yet released)
+- Fixed crashing `get(ID)` if notification doesn't exist
+
 #### Version 0.8.2 (08.11.2015)
 - Submitted to npm
 - Initial support for the `windows` platform

+ 1 - 1
src/ios/APPLocalNotification.m

@@ -393,7 +393,7 @@
         }
 
         result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
-                                    messageAsDictionary:notifications[0]];
+                               messageAsDictionary:[notifications firstObject]];
 
         [self.commandDelegate sendPluginResult:result
                                     callbackId:command.callbackId];