[NUI] Fix Svace issues
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / EXaml / Block / GatherTypesBlock.cs
index 76c18ca..0fe0255 100755 (executable)
@@ -1,4 +1,20 @@
-using System;
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+using System;
 using System.Collections.Generic;
 using System.Reflection;
 using System.Text;
@@ -7,12 +23,14 @@ namespace Tizen.NUI.EXaml
 {
     internal class GatherTypesBlock : Action
     {
-        public GatherTypesBlock(Action parent)
+        public GatherTypesBlock(GlobalDataList globalDataList, Action parent)
         {
             this.parent = parent;
+            this.globalDataList = globalDataList;
         }
 
         private Action parent;
+        private GlobalDataList globalDataList;
 
         public Action DealChar(char c)
         {
@@ -44,7 +62,7 @@ namespace Tizen.NUI.EXaml
 
         public void OnActive()
         {
-            LoadEXaml.Operations.Add(GatherType(childOp.ValueList));
+            globalDataList.Operations.Add(GatherType(childOp.ValueList));
             childOp = null;
         }
 
@@ -57,16 +75,18 @@ namespace Tizen.NUI.EXaml
             {
                 List<int> genericTypeIndexs = new List<int>();
                 var genericTypeIndexList = valueList[1] as List<object>;
-                foreach (var index in genericTypeIndexList)
+                if (genericTypeIndexList != null)
                 {
-                    genericTypeIndexs.Add((int)index);
+                    foreach (var index in genericTypeIndexList)
+                    {
+                        genericTypeIndexs.Add((int)index);
+                    }
                 }
-
-                return new GatherType(assemblyIndex, typeName, genericTypeIndexs);
+                return new GatherType(globalDataList, assemblyIndex, typeName, genericTypeIndexs);
             }
             else
             {
-                return new GatherType(assemblyIndex, typeName);
+                return new GatherType(globalDataList, assemblyIndex, typeName);
             }
         }
     }