Commit 8117013
authored
fix(android): Prevent potential crash in checkPowerServiceSaveMode
The checkPowerServiceSaveMode method used a non-null assertion (!!)
on applicationContext. This could potentially lead to a NullPointerException
in rare edge cases.
This change replaces the assertion with a safe-call block (`?.let`),
ensuring the method safely returns `false` if the context is null,
thereby improving the plugin's robustness.1 parent b49befe commit 8117013
File tree
1 file changed
+4
-3
lines changed- packages/battery_plus/battery_plus/android/src/main/kotlin/dev/fluttercommunity/plus/battery
1 file changed
+4
-3
lines changedLines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
174 | | - | |
175 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
176 | 177 | | |
177 | 178 | | |
178 | 179 | | |
| |||
0 commit comments