[NUI] Fix Svace issue (#727)
authorhuiyueun <35286162+huiyueun@users.noreply.github.com>
Tue, 26 Feb 2019 05:11:07 +0000 (14:11 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Tue, 26 Feb 2019 05:11:07 +0000 (14:11 +0900)
Signed-off-by: huiyu.eun <huiyu.eun@samsung.com>
src/Tizen.NUI/src/internal/Xaml/MarkupExtensionParser.cs
src/Tizen.NUI/src/internal/XamlBinding/Interactivity/AttachedCollection.cs

index ec76d26..e36449e 100755 (executable)
@@ -64,14 +64,14 @@ namespace Tizen.NUI.Xaml
                 prop = ApplyPropertiesVisitor.GetContentPropertyName(t.GetTypeInfo());
                 if (prop == null)
                     return;
-                setter = t.GetRuntimeProperty(prop).SetMethod;
+                setter = t.GetRuntimeProperty(prop)?.SetMethod;
             }
             else
-                setter = markupExtension.GetType().GetRuntimeProperty(prop).SetMethod;
+                setter = markupExtension.GetType().GetRuntimeProperty(prop)?.SetMethod;
 
             if (value == null && strValue != null)
             {
-                value = strValue.ConvertTo(markupExtension.GetType().GetRuntimeProperty(prop).PropertyType,
+                value = strValue.ConvertTo(markupExtension.GetType().GetRuntimeProperty(prop)?.PropertyType,
                     (Func<TypeConverter>)null, serviceProvider);
             }
 
index d5d1fc3..b1c5247 100755 (executable)
@@ -41,7 +41,7 @@ namespace Tizen.NUI.Binding
                     var bindable = weakbindable.Target as BindableObject;
                     if (bindable == null)
                         continue;
-                    item.DetachFrom(bindable);
+                    item?.DetachFrom(bindable);
                 }
             }
             base.ClearItems();
@@ -55,7 +55,7 @@ namespace Tizen.NUI.Binding
                 var bindable = weakbindable.Target as BindableObject;
                 if (bindable == null)
                     continue;
-                item.AttachTo(bindable);
+                item?.AttachTo(bindable);
             }
         }
 
@@ -66,13 +66,13 @@ namespace Tizen.NUI.Binding
                 _associatedObjects.Add(new WeakReference(bindable));
             }
             foreach (T item in this)
-                item.AttachTo(bindable);
+                item?.AttachTo(bindable);
         }
 
         protected virtual void OnDetachingFrom(BindableObject bindable)
         {
             foreach (T item in this)
-                item.DetachFrom(bindable);
+                item?.DetachFrom(bindable);
             lock (_associatedObjects)
             {
                 for (var i = 0; i < _associatedObjects.Count; i++)
@@ -96,7 +96,7 @@ namespace Tizen.NUI.Binding
                 var bindable = weakbindable.Target as BindableObject;
                 if (bindable == null)
                     continue;
-                item.DetachFrom(bindable);
+                item?.DetachFrom(bindable);
             }
 
             base.RemoveItem(index);
@@ -110,7 +110,7 @@ namespace Tizen.NUI.Binding
                 var bindable = weakbindable.Target as BindableObject;
                 if (bindable == null)
                     continue;
-                old.DetachFrom(bindable);
+                old?.DetachFrom(bindable);
             }
 
             base.SetItem(index, item);
@@ -120,7 +120,7 @@ namespace Tizen.NUI.Binding
                 var bindable = weakbindable.Target as BindableObject;
                 if (bindable == null)
                     continue;
-                item.AttachTo(bindable);
+                item?.AttachTo(bindable);
             }
         }
     }