From 5795f5ff1943ae7ac9144a321c1c63bab6f5fb56 Mon Sep 17 00:00:00 2001 From: "huayong.xu" Date: Thu, 20 Apr 2023 14:42:43 +0800 Subject: [PATCH] Fix SVACE issues. --- .../Controls/Navigation/ContentPage.cs | 4 ++-- .../Controls/RecyclerView/CollectionView.cs | 16 ++++++++++------ src/Tizen.NUI/src/public/BaseComponents/View.cs | 9 ++++++--- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/Tizen.NUI.Components/Controls/Navigation/ContentPage.cs b/src/Tizen.NUI.Components/Controls/Navigation/ContentPage.cs index 1669518..8e43308 100755 --- a/src/Tizen.NUI.Components/Controls/Navigation/ContentPage.cs +++ b/src/Tizen.NUI.Components/Controls/Navigation/ContentPage.cs @@ -190,9 +190,9 @@ namespace Tizen.NUI.Components } else { - if (AppBar != null) + if (AppBar is var bar && bar != null) { - FocusManager.Instance.SetCurrentFocusView(AppBar.PassFocusableViewInsideIfNeeded()); + FocusManager.Instance.SetCurrentFocusView(bar.PassFocusableViewInsideIfNeeded()); } else { diff --git a/src/Tizen.NUI.Components/Controls/RecyclerView/CollectionView.cs b/src/Tizen.NUI.Components/Controls/RecyclerView/CollectionView.cs index 4a566cb..52adc96 100755 --- a/src/Tizen.NUI.Components/Controls/RecyclerView/CollectionView.cs +++ b/src/Tizen.NUI.Components/Controls/RecyclerView/CollectionView.cs @@ -985,7 +985,11 @@ namespace Tizen.NUI.Components return Header; } - if (index == InternalSource.Count - 1 && Footer != null) + var source = InternalSource; + if (source == null) + return null; + + if (index == source.Count - 1 && Footer != null) { Footer.Show(); return Footer; @@ -993,14 +997,14 @@ namespace Tizen.NUI.Components if (isGrouped) { - var context = InternalSource.GetItem(index); - if (InternalSource.IsGroupHeader(index)) + if (source.IsGroupHeader(index)) { + var context = source.GetItem(index); item = RealizeGroupHeader(index, context); } - else if (InternalSource.IsGroupFooter(index)) + else if (source.IsGroupFooter(index)) { - + var context = source.GetItem(index); //group selection? item = RealizeGroupFooter(index, context); } @@ -1011,7 +1015,7 @@ namespace Tizen.NUI.Components { throw new Exception("Item realize failed by Null content return."); } - item.ParentGroup = InternalSource.GetGroupParent(index); + item.ParentGroup = source.GetGroupParent(index); } } else diff --git a/src/Tizen.NUI/src/public/BaseComponents/View.cs b/src/Tizen.NUI/src/public/BaseComponents/View.cs index 4cf775f..a831ade 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/View.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/View.cs @@ -1545,9 +1545,12 @@ namespace Tizen.NUI.BaseComponents { Vector3 temp = GetNaturalSize(); if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); - - Size2D sz = new Size2D((int)temp.Width, (int)temp.Height); - temp.Dispose(); + Size2D sz = null; + if (temp != null) + { + sz = new Size2D((int)temp.Width, (int)temp.Height); + temp.Dispose(); + } return sz; } } -- 2.7.4