Skip to content

Commit

Permalink
Parsing DeviceInfo.Version could fail in Android 7
Browse files Browse the repository at this point in the history
  • Loading branch information
lswiderski committed Aug 20, 2022
1 parent 726c280 commit 972a795
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/MiScaleExporter/ViewModels/ScaleViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ private async void OnScan()

if (DeviceInfo.Platform == DevicePlatform.Android)
{
var version = double.Parse(DeviceInfo.VersionString);
double version = 0;
double.TryParse(DeviceInfo.VersionString, out version);

if (version >= 12)
{
if (await GetBluetoothPermissionStatusAsync() != PermissionStatus.Granted)
Expand Down

0 comments on commit 972a795

Please sign in to comment.