From d33e322b67043e86c1033c55f67b6339e0d66ed8 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 19 Jul 2018 20:54:33 +0200 Subject: [PATCH] TunnelEditorFragment: fix null pointer dereference Signed-off-by: Jason A. Donenfeld --- .../wireguard/android/fragment/TunnelEditorFragment.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/wireguard/android/fragment/TunnelEditorFragment.java b/app/src/main/java/com/wireguard/android/fragment/TunnelEditorFragment.java index e6e3a19e..ce7c5570 100644 --- a/app/src/main/java/com/wireguard/android/fragment/TunnelEditorFragment.java +++ b/app/src/main/java/com/wireguard/android/fragment/TunnelEditorFragment.java @@ -96,11 +96,13 @@ public class TunnelEditorFragment extends BaseFragment implements AppExclusionLi @Override public void onItemRangeInserted(final ObservableList sender, final int positionStart, final int itemCount) { - breakObjectOrientedLayeringHandler.onPropertyChanged(binding.getConfig(), BR.peers); + if (binding != null) + breakObjectOrientedLayeringHandler.onPropertyChanged(binding.getConfig(), BR.peers); } @Override public void onItemRangeRemoved(final ObservableList sender, final int positionStart, final int itemCount) { - breakObjectOrientedLayeringHandler.onPropertyChanged(binding.getConfig(), BR.peers); + if (binding != null) + breakObjectOrientedLayeringHandler.onPropertyChanged(binding.getConfig(), BR.peers); } };