summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Android
diff options
context:
space:
mode:
authorE.Z. Hart <hartez@users.noreply.github.com>2016-12-14 17:13:17 -0700
committerGitHub <noreply@github.com>2016-12-14 17:13:17 -0700
commit8f1bb7b4b2ae8fd182c3874f208a12d549d230dd (patch)
treeab5f5c4b784065827248d2b4ea40dde23571f90b /Xamarin.Forms.Platform.Android
parent1c5de535739e92d0c6dca335c024503b08d1a2af (diff)
downloadxamarin-forms-8f1bb7b4b2ae8fd182c3874f208a12d549d230dd.tar.gz
xamarin-forms-8f1bb7b4b2ae8fd182c3874f208a12d549d230dd.tar.bz2
xamarin-forms-8f1bb7b4b2ae8fd182c3874f208a12d549d230dd.zip
Fix potential NRE in ConditionalFocusLayout (#587)2.3.3.175
Diffstat (limited to 'Xamarin.Forms.Platform.Android')
-rw-r--r--Xamarin.Forms.Platform.Android/Renderers/ConditionalFocusLayout.cs9
1 files changed, 3 insertions, 6 deletions
diff --git a/Xamarin.Forms.Platform.Android/Renderers/ConditionalFocusLayout.cs b/Xamarin.Forms.Platform.Android/Renderers/ConditionalFocusLayout.cs
index 6368d023..311db6b8 100644
--- a/Xamarin.Forms.Platform.Android/Renderers/ConditionalFocusLayout.cs
+++ b/Xamarin.Forms.Platform.Android/Renderers/ConditionalFocusLayout.cs
@@ -26,12 +26,11 @@ namespace Xamarin.Forms.Platform.Android
(aView as EntryCellView)?.EditText.SetOnTouchListener(this);
var viewCell = item as ViewCell;
- if (viewCell == null || viewCell?.View == null)
+ if (viewCell?.View == null)
return;
IVisualElementRenderer renderer = Platform.GetRenderer(viewCell.View);
- if (renderer?.ViewGroup?.ChildCount != 0)
- (renderer.ViewGroup.GetChildAt(0) as EditText)?.SetOnTouchListener(this);
+ (renderer?.ViewGroup?.GetChildAt(0) as EditText)?.SetOnTouchListener(this);
foreach (Element descendant in viewCell.View.Descendants())
{
@@ -39,9 +38,7 @@ namespace Xamarin.Forms.Platform.Android
if (element == null)
continue;
renderer = Platform.GetRenderer(element);
- if (renderer?.ViewGroup?.ChildCount == 0)
- continue;
- (renderer.ViewGroup.GetChildAt(0) as EditText)?.SetOnTouchListener(this);
+ (renderer?.ViewGroup?.GetChildAt(0) as EditText)?.SetOnTouchListener(this);
}
}
}