From: Anuj Kumar Singh Date: Thu, 13 Jul 2023 08:27:05 +0000 (+0530) Subject: Handle exception in case of error in stopping bluetooth discovery X-Git-Tag: accepted/tizen/unified/20230718.162148^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F59%2F295759%2F2;p=profile%2Fiot%2Fapps%2Fdotnet%2Fsetting-bluetooth.git Handle exception in case of error in stopping bluetooth discovery Change-Id: I5426479f3426c731cf7f94637807a5bab05db691 Signed-off-by: Anuj Kumar Singh --- diff --git a/SettingBluetooth/SettingBluetooth/SettingBluetooth.cs b/SettingBluetooth/SettingBluetooth/SettingBluetooth.cs index 8236469..54cca7f 100644 --- a/SettingBluetooth/SettingBluetooth/SettingBluetooth.cs +++ b/SettingBluetooth/SettingBluetooth/SettingBluetooth.cs @@ -65,9 +65,16 @@ namespace SettingBluetooth protected override void OnDestroy() { Log.Info(LogTag, "OnDestroy"); - if (BtModel.IsScanning) + try { - BtModel.StopDiscovery(); + if (BtModel.IsScanning) + { + BtModel.StopDiscovery(); + } + } + catch (Exception e) + { + Log.Error(SettingBluetooth.LogTag, "StopDiscovery failed: " + e.ToString()); } base.OnDestroy(); } diff --git a/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk b/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk index dad83b6..0a35e66 100644 Binary files a/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk and b/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk differ