[ 
https://issues.apache.org/jira/browse/CB-6721?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14003033#comment-14003033
 ] 

Shazron Abdullah commented on CB-6721:
--------------------------------------

The fix is, you must do a null check on info.level (level can be null -- 
https://github.com/apache/cordova-plugin-battery-status/blob/dbdcbebaa9a524f9dcef7816345ffa4b82109f21/src/ios/CDVBattery.m#L90)

Line:
https://github.com/apache/cordova-plugin-battery-status/blob/dbdcbebaa9a524f9dcef7816345ffa4b82109f21/www/battery.js#L71

Also, these assignments below should only happen when something changed, so it 
should be in the if block mentioned above:
https://github.com/apache/cordova-plugin-battery-status/blob/dbdcbebaa9a524f9dcef7816345ffa4b82109f21/www/battery.js#L88-L89


> iOS Failed test: battery.spec.4 should fire batterycritical events
> ------------------------------------------------------------------
>
>                 Key: CB-6721
>                 URL: https://issues.apache.org/jira/browse/CB-6721
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: mobile-spec, Plugin Battery Status
>            Reporter: Shazron Abdullah
>
> Battery (navigator.battery) battery.spec.4 should fire batterycritical events.
> timeout: timed out after 100 msec waiting for batterycritical onEvent was not 
> called when level goes from 19->5
> This test is new for CB-4520 CB-4519:
> https://github.com/apache/cordova-mobile-spec/commit/b5b80a6ff80d3c8b3d7618fe051c824ec0d3771f



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to