From c135877a65244706008b6215b2734bb37bbfb7f4 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期四, 20 七月 2023 08:59:09 +0800
Subject: [PATCH] Merge branch 'Dev-1.9' into Dev-Branch

---
 HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs |   34 ++++++++++++++++++++++------------
 1 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs
index 1a39122..74a8d34 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs
@@ -433,14 +433,17 @@
                     var pack = pm.GetSceneInfo(scene.userSceneId);
                     if (pack.Code == StateCode.SUCCESS)
                     {
-                        var sceneList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Scene>>(pack.Data.ToString());
-                        var tempScene = sceneList.Find((obj) => obj.userSceneId == scene.userSceneId);
-                        if (tempScene != null)
+                        if (pack.Data != null)
                         {
-                            scene.name = tempScene.name;
-                            scene.delay = tempScene.delay;
-                            scene.roomIds = tempScene.roomIds;
-                            scene.functions = tempScene.functions;
+                            var sceneList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Scene>>(pack.Data.ToString());
+                            var tempScene = sceneList.Find((obj) => obj.userSceneId == scene.userSceneId);
+                            if (tempScene != null)
+                            {
+                                scene.name = tempScene.name;
+                                scene.delay = tempScene.delay;
+                                scene.roomIds = tempScene.roomIds;
+                                scene.functions = tempScene.functions;
+                            }
                         }
                         Application.RunOnMainThread(() =>
                         {
@@ -482,11 +485,18 @@
                     scene.functions.Remove(scenefunction);
                     continue;
                 }
-                //灏唖pk瀹炰綋閲岄潰鐨刴in max鍊兼斁鍏ュ満鏅姛鑳藉疄浣撻噷锛岃涓嶇劧鏁版嵁浼氫涪澶� 2022-06-21 16:06:45
-                foreach (var tt in scenefunction.status) {
-                    tt.min = scenefunction.localFunction.GetAttribute(tt.key).min;
-                    tt.max = scenefunction.localFunction.GetAttribute(tt.key).max;
-                    tt.valueList = scenefunction.localFunction.GetAttribute(tt.key).value;
+                try
+                {
+                    //灏唖pk瀹炰綋閲岄潰鐨刴in max鍊兼斁鍏ュ満鏅姛鑳藉疄浣撻噷锛岃涓嶇劧鏁版嵁浼氫涪澶� 2022-06-21 16:06:45
+                    foreach (var tt in scenefunction.status)
+                    {
+                        tt.min = scenefunction.localFunction.GetAttribute(tt.key).min;
+                        tt.max = scenefunction.localFunction.GetAttribute(tt.key).max;
+                        tt.valueList = scenefunction.localFunction.GetAttribute(tt.key).value;
+                    }
+                }catch(Exception ex)
+                {
+                    MainPage.Log($"鍦烘櫙鍔犺浇鍔熻兘鍒楄〃寮傚父:{ex.Message}");
                 }
 
                 i++;

--
Gitblit v1.8.0