summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Android/CellAdapter.cs
diff options
context:
space:
mode:
authorPaul DiPietro <pauldipietro@users.noreply.github.com>2016-08-02 16:15:35 (GMT)
committerSamantha Houts <samantha@teamredwall.com>2016-08-02 16:15:35 (GMT)
commitac44cf9dec53b3b8be1836f20479f01820f3667f (patch)
tree3b5ebf0580020e3ef5fc4d73d51e87c50f608719 /Xamarin.Forms.Platform.Android/CellAdapter.cs
parentea01c07aa32e39e947104253a44566dded50123e (diff)
downloadxamarin-forms-ac44cf9dec53b3b8be1836f20479f01820f3667f.zip
xamarin-forms-ac44cf9dec53b3b8be1836f20479f01820f3667f.tar.gz
xamarin-forms-ac44cf9dec53b3b8be1836f20479f01820f3667f.tar.bz2
[Android] Add null check to prevent crashes when long clicking a text entry in ListView header/footer (#271)
When a text entry control (Entry, Editor, SearchBar, etc.) was being used in the header or footer of a ListView on Android, a long click/press would cause a crash. This was occurring in the HandleContextMode method because it expected to be a cell. Adding a null check and breaking out of the method if the value from GetCellForPosition is null prevents this crash from occurring.
Diffstat (limited to 'Xamarin.Forms.Platform.Android/CellAdapter.cs')
-rw-r--r--Xamarin.Forms.Platform.Android/CellAdapter.cs3
1 files changed, 3 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.Android/CellAdapter.cs b/Xamarin.Forms.Platform.Android/CellAdapter.cs
index 4c8ac10..d79df76 100644
--- a/Xamarin.Forms.Platform.Android/CellAdapter.cs
+++ b/Xamarin.Forms.Platform.Android/CellAdapter.cs
@@ -211,6 +211,9 @@ namespace Xamarin.Forms.Platform.Android
{
Cell cell = GetCellForPosition(position);
+ if (cell == null)
+ return false;
+
if (_actionMode != null || _supportActionMode != null)
{
if (!cell.HasContextActions)