I have an `Activity` with some `Fragments` used in a `ViewPager`, sometimes user sends me some crash report that i don't understand.

I can not produce this crash and most of the user have no problem at all.

The crash Log says: 

```
java.lang.NullPointerException: Attempt to read from field 'com.mehdok.views.treeview.TreeNode$TreeNodeClickListener com.mehdok.mafatih.MainActivity.nodeClickListener2' on a null object reference

```

The `nodeClickListener2` is in my main activity:

```
public TreeNode.TreeNodeClickListener nodeClickListener2 = new TreeNode.TreeNodeClickListener()
{
    @Override
    public void onClick(TreeNode node, Object value)
    {
        TreeViewHolderNoBorder.TreeViewItem item = (TreeViewHolderNoBorder.TreeViewItem) value;
        if(node.isLeaf() && !item.nodeNavUri.equals(""))
        {
            openNodePage2(item);
        }
    }
};

```

And in fragmets i use it like this:

```
tView.setDefaultNodeClickListener(((MainActivity) getActivity()).nodeClickListener2);

```

What can i do to prevent this crash?

tnx in advance.