Fix NullReferenceException occured issue 28/299328/2
authorWootak Jung <wootak.jung@samsung.com>
Tue, 26 Sep 2023 06:02:09 +0000 (15:02 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Tue, 26 Sep 2023 06:32:02 +0000 (15:32 +0900)
issue occured when using mScanButton before ProvideMoreActions called

Change-Id: I071ec97915211aa1b87f183ca2bf058ba8654270
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
SettingBluetooth/SettingBluetooth/SettingBluetooth.cs
packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk

index af9a729d10cc3993bf791954c924116619ae7f26..39ff96962d9f4c7d42d39b70f6235dd166912984 100644 (file)
@@ -42,6 +42,16 @@ namespace SettingBluetooth
             Log.Info(LogTag, "OnCreate");
             base.OnCreate();
             Resources.SetPath(GetResourcePath("/"));
+
+            ViewStyle viewStyle = GetButtonViewStyle();
+            mScanButton = new Button()
+            {
+                Text = Resources.IDS_BT_SK_SCAN,
+                IsEnabled = BtModel.IsEnabled,
+            };
+            mScanButton.Clicked += AdapterController.ScanButtonClicked;
+            mScanButton.ApplyStyle(viewStyle);
+
             return BtMainView.Create();
         }
 
@@ -59,16 +69,6 @@ namespace SettingBluetooth
 
         public override IEnumerable<View> ProvideMoreActions()
         {
-            ViewStyle viewStyle = GetButtonViewStyle();
-
-            mScanButton = new Button()
-            {
-                Text = Resources.IDS_BT_SK_SCAN,
-                IsEnabled = BtModel.IsEnabled,
-            };
-            mScanButton.Clicked += AdapterController.ScanButtonClicked;
-            mScanButton.ApplyStyle(viewStyle);
-
             return new View[] { mScanButton };
         }
 
index 9cf047f76dd204d14558e6e07a1e20367a3cd68c..be7265fde8c3c2fc127cf0b1201c13f5e3b73392 100644 (file)
Binary files a/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk and b/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk differ