[NUI] Fix svace issue (#687)
authorhuiyueun <35286162+huiyueun@users.noreply.github.com>
Mon, 28 Jan 2019 08:07:28 +0000 (17:07 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Mon, 28 Jan 2019 08:07:28 +0000 (17:07 +0900)
Add null check

Signed-off-by: huiyu.eun <huiyu.eun@samsung.com>
src/Tizen.NUI/src/internal/XamlBinding/ObservableWrapper.cs

index dcf80ec..b897657 100755 (executable)
@@ -160,7 +160,7 @@ namespace Tizen.NUI.Binding
                     if (e.NewStartingIndex == -1 || e.NewItems?.Count > 1)
                         goto case NotifyCollectionChangedAction.Reset;
 
-                    var newItem = e.NewItems[0] as TRestrict;
+                    var newItem = e.NewItems?[0] as TRestrict;
                     if (newItem == null || !newItem.Owned)
                         break;
 
@@ -171,7 +171,7 @@ namespace Tizen.NUI.Binding
                     if (e.NewStartingIndex == -1 || e.OldStartingIndex == -1 || e.NewItems?.Count > 1)
                         goto case NotifyCollectionChangedAction.Reset;
 
-                    var movedItem = e.NewItems[0] as TRestrict;
+                    var movedItem = e.NewItems?[0] as TRestrict;
                     if (movedItem == null || !movedItem.Owned)
                         break;