Fix Left/Right/Up/DownFocusableView bug 75/156275/1
authorFeng Jin <feng16.jin@samsung.com>
Mon, 16 Oct 2017 10:45:46 +0000 (18:45 +0800)
committerFeng Jin <feng16.jin@samsung.com>
Wed, 18 Oct 2017 09:46:03 +0000 (17:46 +0800)
 =>If app set the  Left/Right/Up/DownFocusableView to null, then it will be crash.

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

index 3f23151..02603cc 100755 (executable)
@@ -13,7 +13,6 @@
 * limitations under the License.
 *
 */
-
 namespace Tizen.NUI.BaseComponents
 {
 
@@ -1837,7 +1836,14 @@ namespace Tizen.NUI.BaseComponents
             }
             set
             {
-                LeftFocusableViewId = (int)value.GetId();
+                if(value)
+                {
+                    LeftFocusableViewId = (int)value.GetId();
+                }
+                else
+                {
+                    LeftFocusableViewId = -1;
+                }
             }
         }
 
@@ -1859,7 +1865,14 @@ namespace Tizen.NUI.BaseComponents
             }
             set
             {
-                RightFocusableViewId = (int)value.GetId();
+                if(value)
+                {
+                    RightFocusableViewId = (int)value.GetId();
+                }
+                else
+                {
+                    RightFocusableViewId = -1;
+                }
             }
         }
 
@@ -1881,7 +1894,14 @@ namespace Tizen.NUI.BaseComponents
             }
             set
             {
-                UpFocusableViewId = (int)value.GetId();
+                if(value)
+                {
+                    UpFocusableViewId = (int)value.GetId();
+                }
+                else
+                {
+                    UpFocusableViewId = -1;
+                }
             }
         }
 
@@ -1903,7 +1923,14 @@ namespace Tizen.NUI.BaseComponents
             }
             set
             {
-                DownFocusableViewId = (int)value.GetId();
+                if(value)
+                {
+                    DownFocusableViewId = (int)value.GetId();
+                }
+                else
+                {
+                    DownFocusableViewId = -1;
+                }
             }
         }