App crashes when no matches found in search on ios 14

try to search smth  that does not match anything in the list. App crashes  instead of showing "No Results Found"
see example below. Ios 14 
sfAutocomplette version 18.3.0.38
   
   public MainPage()
        {
            InitializeComponent();
            StackLayout stackLayout = new StackLayout()
            {
                VerticalOptions = LayoutOptions.CenterAndExpand,
                HorizontalOptions = LayoutOptions.Start,
                Padding = new Thickness(30)
            };
            SfAutoComplete autoComplete = new SfAutoComplete()
            {
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                VerticalOptions = LayoutOptions.CenterAndExpand,
                TextColor = Color.Black,
                NoResultsFoundText = "No Results Found",
                NoResultsFoundFontAttributes = FontAttributes.Bold,
                NoResultsFoundFontSize = 20,
                NoResultsFoundTextColor = Color.DarkGreen,
                AutoCompleteSource = new List<string>()
                {
                    "India",
                    "Uganda",
                    "Ukraine",
                    "Canada",
                    "United Arab Emirates"
                }
            };

            stackLayout.Children.Add(autoComplete);
            this.Content = stackLayout;
        }

11 Replies 1 reply marked as answer

SP Sakthivel Palaniyappan Syncfusion Team October 13, 2020 09:51 AM UTC

Hi Andrey,

Greetings from Syncfusion.

We have analyzed your query and we have already fixed the reported issue and included the fix in our latest Weekly NuGet release update version 18.3.0.40 which is available for download (https://www.nuget.org/ ).

Please let us know if you have any other queries.

Regards,
Sakthivel P.



GD gabriel de sousa October 14, 2020 02:30 AM UTC

I try with 18.3.0.40 and app crash when datasource is null. Check the stack

{System.NullReferenceException: Object reference not set to an instance of an object  at Syncfusion.iOS.ComboBox.SfComboBox.SetSelectedValuesbasedOnInitialText () [0x00198] in <2379e8a184f64464a7fd4ba2035b9db8>:0   at Syncfusion.iOS.ComboBox.SfComboBox.set_DataSource (System.Collections.Generic.IEnumerable`1[T] value) [0x000fa] in <2379e8a184f64464a7fd4ba2035b9db8>:0   at Syncfusion.iOS.ComboBox.SfComboBox.OnComboBoxPropertiesChanged (System.String propertyName, Syncfusion.XForms.ComboBox.SfComboBox formsComboBox, Syncfusion.iOS.ComboBox.SfComboBox nativeComboBox) [0x00294] in <2379e8a184f64464a7fd4ba2035b9db8>:0   at Syncfusion.XForms.iOS.ComboBox.SfComboBoxRenderer.OnElementPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x00054] in <2379e8a184f64464a7fd4ba2035b9db8>:0   at (wrapper delegate-invoke) .invoke_void_object_PropertyChangedEventArgs(object,System.ComponentModel.PropertyChangedEventArgs)  at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:229   at Xamarin.Forms.Element.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:358   at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00114] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:461   at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x00173] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:397   at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) [0x00214] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:155   at Xamarin.Forms.BindingExpression.Apply (System.Boolean fromTarget) [0x0003e] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:53   at Xamarin.Forms.BindingExpression+BindingExpressionPart.b__49_0 () [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:742   at Xamarin.Forms.BindingExpression+BindingExpressionPart.PropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs args) [0x000cb] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:753   at Xamarin.Forms.BindingExpression+WeakPropertyChangedProxy.OnPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x00012] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:646   at (wrapper delegate-invoke) .invoke_void_object_PropertyChangedEventArgs(object,System.ComponentModel.PropertyChangedEventArgs)  at Nectar.Mobile.Framework.Helper.ObservableObject.OnPropertyChanged (System.String propertyName) [0x00001] in C:\Nectar\Nectar.Mobile\Nectar.Mobile\Nectar.Mobile.Framework\Helper\ObservableObject.cs:29   at Nectar.Mobile.Data.Entities.SolicitacaoAplicacaoDefensivoOrdemProducao.set_Ordem (Nectar.Mobile.Data.Entities.Ordem value) [0x0001b] in C:\Nectar\Nectar.Mobile\Nectar.Mobile.Data\Entities\SolicitacaoAplicacaoDefensivoOrdemProducao.cs:108   at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)  at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:395 }


SP Sakthivel Palaniyappan Syncfusion Team October 15, 2020 03:47 AM UTC

Hi Gabriel,

We have checked the reported issue and we could able reproduce the same. We are currently analyzing the root cause of an issue and we will update the details on October, 16, 2020. We appreciate your patience until then.

Regards,
Sakthivel P.
 



SP Sakthivel Palaniyappan Syncfusion Team October 16, 2020 04:01 PM UTC

Hi Gabriel,

Thanks for the patience.

We have fixed the reported issue of “Null reference exception” and please find the assemblies from below.

Custom Assemblies:

SfComboBox:
https://www.syncfusion.com/downloads/support/directtrac/general/ze/SfComboBox-476314075.zip

SfAutoComplete:
https://www.syncfusion.com/downloads/support/directtrac/general/ze/SfAutoComplete525488765.zip

Assembly version : 18.3.0.40

Since 18.3.0.40 is a weekly NuGet release, we are not able to generate patch 18.3.0.40 version. We can generate patch only for Main release and SP1 release versions, so we have provided the custom assemblies in 18.3.0.40.

Disclaimer:
Please note that we have created this for version
18.3.0.40 specifically to resolve the issue reported in this incident. If you have received other patches for the same version for other products, please apply all patches in the order received.

Please refer the  below link for how to apply custom assemblies.
https://www.syncfusion.com/kb/8279/how-to-apply-the-custom-assemblies-when-configured-the-project-with-syncfusion-nuget


Fix for the reported issue will be included in our upcoming weekly NuGet release, which will be available on October 27, 2020.

Regards,
Sakthivel P.
 



AL Alex October 27, 2020 10:55 AM UTC

Is 18.3.0.44 including the fix for this?


AL Alex October 27, 2020 11:37 AM UTC

Still happening in .44f

System.NullReferenceException: Object reference not set to an instance of an object
  at Syncfusion.iOS.ComboBox.SfComboBox.SetSelectedValuesbasedOnInitialText () [0x0019d] in <5306a4315ff1408c9be12ea8e1c25aa2>:0 
  at Syncfusion.iOS.ComboBox.SfComboBox.set_DataSource (System.Collections.Generic.IEnumerable`1[T] value) [0x000fa] in <5306a4315ff1408c9be12ea8e1c25aa2>:0 
  at Syncfusion.iOS.ComboBox.SfComboBox.OnComboBoxPropertiesChanged (System.String propertyName, Syncfusion.XForms.ComboBox.SfComboBox formsComboBox, Syncfusion.iOS.ComboBox.SfComboBox nativeComboBox) [0x00294] in <5306a4315ff1408c9be12ea8e1c25aa2>:0 
  at Syncfusion.XForms.iOS.ComboBox.SfComboBoxRenderer.InitialPropertyMapping () [0x0003d] in <5306a4315ff1408c9be12ea8e1c25aa2>:0 
  at Syncfusion.XForms.iOS.ComboBox.SfComboBoxRenderer.OnElementChanged (Xamarin.Forms.Platform.iOS.El
ementChangedEventArgs`1[TElement] e) [0x0015a] in <5306a4315ff1408c9be12ea8e1c25aa2>:0 
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x00172] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:296 
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:158 
  at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:227 
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x0003e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:115 
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () [0x0001e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:49 
  at Xamarin.Forms.Platform.iOS.Visu
alElementRenderer`1[TElement].SetElement (TElement element) [0x0012e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:283 
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:158 
  at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:227 
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x0003e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:115 
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () [0x0001e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:49 
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x0012e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRe
nderer.cs:283 
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:158 
  at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:227 

Attachment: full_stacktrace_10446438.7z


AL Alex October 27, 2020 11:42 AM UTC

I want to mention that the datasource is not NULL. Just empty.

Can be reproduced by binding a new ObservableCollection<T> to a ComboBox. It occurs on all pages which contain a Combobox where the datasource is empty.

Seems like there should be a check in place to show the EmptyText which was there before but is now gone.



SP Sakthivel Palaniyappan Syncfusion Team October 28, 2020 10:56 AM UTC

Hi Alex,

Greetings from Syncfusion.

We have analyzed your query and checked the reported issue with your provided information, but we could not able to reproduce the reported issue. Please find the sample from below.

Sample:
https://www.syncfusion.com/downloads/support/directtrac/general/ze/ComboBoxSample-1352895091.zip  
 
Since we are not aware of exact scenario of the issue, could you please check the issue with the attached sample and let us know whether it is reproduced or not? If the issue was not reproduced in this sample, please revert us by modifying the sample based on your application along with replication procedure or provide the sample. This will be helpful for us to investigate further and provide you a better solution at the earliest.

Regards,
Sakthivel P.
 



GD gabriel de sousa October 28, 2020 06:00 PM UTC

Hi I decompile using dotPeek and found problem is in your method SetSelectedValuesbasedOnInitialText > "foreach > this.newDataSource". Just check if this variable "this.newDataSource" is not null before do loop.

This image attached show two points to fix.

To reproduce the problem just set DataSource in SfComboBox to null in runtime.

Attachment: error_ios_bcd21c61.rar


SP Sakthivel Palaniyappan Syncfusion Team October 29, 2020 05:59 PM UTC

Hi Gabriel,

Thanks for the update.

We have fixed the reported issue of “Null reference exception throws in iOS” and please find the assemblies from below.

Custom Assemblies:
https://www.syncfusion.com/downloads/support/directtrac/general/ze/SfComboBox1864578895.zip

Assembly version : 18.3.0.44

Since 18.3.0.44 is a weekly NuGet release, we are not able to generate patch 18.3.0.44 version. We can generate patch only for Main release and SP1 release versions, so we have provided the custom assemblies in 18.3.0.44

Disclaimer:
Please note that we have created this for version
18.3.0.44 specifically to resolve the issue reported in this incident. If you have received other patches for the same version for other products, please apply all patches in the order received.

Please refer the  below link for how to apply custom assemblies.
https://www.syncfusion.com/kb/8279/how-to-apply-the-custom-assemblies-when-configured-the-project-with-syncfusion-nuget


Fix for the reported issue will be included in our upcoming weekly NuGet release, which will be available on November 10, 2020.

Regards,
Sakthivel P.
 



SP Sakthivel Palaniyappan Syncfusion Team November 11, 2020 12:51 PM UTC

Hi Gabriel,

Thank you for your patience.

We have fixed the reported issue “Null Reference Exception thrown when set null to DataSource dynamically” and included the issue fix in our latest Weekly NuGet release update version 18.3.0.48 which is available for download (https://www.nuget.org/ ).

We thank you for your support and appreciate your patience in waiting for this update. Please get in touch with us if you would require any further assistance.

Regards,
Sakthivel P


Marked as answer
Loader.
Up arrow icon