I have a list with 16967 items and when querying the list and no results are found instead of count = 0 or zero results it throws, "System.NullReferenceException: Object reference not set to an instance of an object" is throwing.
var result = englishWords.Where(c => c.engWord.StartsWith(searchWord.ToLower()));
when the result of the querying is no results, the variable "result" is throwing null reference exception instead of zero results or no result. Any help would be appreciated?
[ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object. 12-28 13:32:08.284 E/mono-rt ( 8929): at TigrinyaDictionary.Views.ItemsPage+<>c__DisplayClass20_0.<MainSearchBar_TextChanged>b__0 (TigrinyaDictionary.Models.EngWord c) [0x00000] in C:\Users\Default\Desktop\Projects\Dictionary\MobileApp\TigrinyaDictionary\TigrinyaDictionary\Views\ItemsPage.xaml.cs:202 12-28 13:32:08.284 E/mono-rt ( 8929): at System.Linq.Enumerable+WhereSelectListIterator
2[TSource,TResult].MoveNext () [0x00037] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/external/corefx/src/System.Linq/src/System/Linq/Where.cs:574 12-28 13:32:08.284 E/mono-rt ( 8929): at System.Linq.Enumerable+EnumerablePartition
1[TSource].ToList () [0x00012] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/external/corefx/src/System.Linq/src/System/Linq/Partition.cs:629 12-28 13:32:08.284 E/mono-rt ( 8929): at System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x0000e] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/external/corefx/src/System.Linq/src/System/Linq/ToCollection.cs:30 12-28 13:32:08.284 E/mono-rt ( 8929): at TigrinyaDictionary.Views.ItemsPage.MainSearchBar_TextChanged (System.Object sender, Xamarin.Forms.TextChangedEventArgs e) [0x00220] in C:\Users\Default\Desktop\Projects\Dictionary\MobileApp\TigrinyaDictionary\TigrinyaDictionary\Views\ItemsPage.xaml.cs:205