Skip to content

Commit

Permalink
fix(android): fix android crash on Android API 27, #579
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyokone committed Jun 8, 2021
1 parent ca370c5 commit 735e15c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ assignees: ''
---

**Describe the bug**
A clear and concise description of what the bug is.
A clear and concise description of what the bug is. Have you tried running `flutter clean` first ?

**Expected behavior**
A clear and concise description of what you expected to happen.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import android.location.LocationManager;
import android.location.OnNmeaMessageListener;
import android.os.Build;
import android.os.Bundle;
import android.os.Looper;
import android.util.Log;
import android.util.SparseArray;
Expand Down Expand Up @@ -236,7 +237,10 @@ public void onLocationResult(LocationResult locationResult) {
}

loc.put("provider", location.getProvider());
loc.put("satelliteNumber", location.getExtras().get("satellites"));
final Bundle extras = location.getExtras();
if (extras != null) {
loc.put("satelliteNumber", location.getExtras().get("satellites"));
}

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
loc.put("elapsedRealtimeNanos", (double) location.getElapsedRealtimeNanos());
Expand Down

0 comments on commit 735e15c

Please sign in to comment.