Fix Left/Right/Up/DownFocusableView bug 76/156276/1
authorFeng Jin <feng16.jin@samsung.com>
Wed, 18 Oct 2017 09:51:29 +0000 (17:51 +0800)
committerFeng Jin <feng16.jin@samsung.com>
Wed, 18 Oct 2017 09:52:51 +0000 (17:52 +0800)
=>If app set the Left/Right/Up/DownFocusableView to null, then it will be crash.

Change-Id: I3a9c68e98a9ef010a67d31221da239dcf37ece6e
Signed-off-by: Feng Jin <feng16.jin@samsung.com>
src/Tizen.NUI/src/public/BaseComponents/View.cs

index 02ff6ba..a049f3f 100755 (executable)
@@ -1912,7 +1912,14 @@ namespace Tizen.NUI.BaseComponents
             }
             set
             {
-                LeftFocusableViewId = (int)value.GetId();
+                if(value)
+                {
+                    LeftFocusableViewId = (int)value.GetId();
+                }
+                else
+                {
+                    LeftFocusableViewId = -1;
+                }
             }
         }
 
@@ -1935,7 +1942,14 @@ namespace Tizen.NUI.BaseComponents
             }
             set
             {
-                RightFocusableViewId = (int)value.GetId();
+                if(value)
+                {
+                    RightFocusableViewId = (int)value.GetId();
+                }
+                else
+                {
+                    RightFocusableViewId = -1;
+                }
             }
         }
 
@@ -1958,7 +1972,14 @@ namespace Tizen.NUI.BaseComponents
             }
             set
             {
-                UpFocusableViewId = (int)value.GetId();
+                if(value)
+                {
+                    UpFocusableViewId = (int)value.GetId();
+                }
+                else
+                {
+                    UpFocusableViewId = -1;
+                }
             }
         }
 
@@ -1981,7 +2002,14 @@ namespace Tizen.NUI.BaseComponents
             }
             set
             {
-                DownFocusableViewId = (int)value.GetId();
+                if(value)
+                {
+                    DownFocusableViewId = (int)value.GetId();
+                }
+                else
+                {
+                    DownFocusableViewId = -1;
+                }
             }
         }