Bug 965822 - Add null check to HomeListView.setOnItemClickListener. r=lucasr
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Thu, 06 Mar 2014 09:25:02 -0800
changeset 172293 04add14e8bbf3f617a5277be5f85c179d13c1a99
parent 172292 dcec4c42cd18c3b0e200b4ad8fde095ecf9caabd
child 172294 9be47a5684e68873224658e9c16692e247c616e0
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewerslucasr
bugs965822
milestone30.0a1
Bug 965822 - Add null check to HomeListView.setOnItemClickListener. r=lucasr
mobile/android/base/home/HomeListView.java
--- a/mobile/android/base/home/HomeListView.java
+++ b/mobile/android/base/home/HomeListView.java
@@ -99,16 +99,21 @@ public class HomeListView extends ListVi
 
     @Override
     public ContextMenuInfo getContextMenuInfo() {
         return mContextMenuInfo;
     }
 
     @Override
     public void setOnItemClickListener(final AdapterView.OnItemClickListener listener) {
+        if (listener == null) {
+            super.setOnItemClickListener(null);
+            return;
+        }
+
         super.setOnItemClickListener(new AdapterView.OnItemClickListener() {
             @Override
             public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                 if (mShowTopDivider) {
                     position--;
                 }
 
                 listener.onItemClick(parent, view, position, id);