Fix NPE in CandidateView.offsetMargin
Bug: 4609124 Change-Id: I14913afba80732e6beb8458b404001798a221a79main
parent
86e815a142
commit
862e05a8f0
|
@ -363,6 +363,8 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void offsetMargin(View v, int dx, int dy) {
|
private static void offsetMargin(View v, int dx, int dy) {
|
||||||
|
if (v == null)
|
||||||
|
return;
|
||||||
ViewGroup.LayoutParams lp = v.getLayoutParams();
|
ViewGroup.LayoutParams lp = v.getLayoutParams();
|
||||||
if (lp instanceof ViewGroup.MarginLayoutParams) {
|
if (lp instanceof ViewGroup.MarginLayoutParams) {
|
||||||
ViewGroup.MarginLayoutParams mlp = (ViewGroup.MarginLayoutParams)lp;
|
ViewGroup.MarginLayoutParams mlp = (ViewGroup.MarginLayoutParams)lp;
|
||||||
|
|
Loading…
Reference in New Issue