I am using treeview in C# and VS2005

```
if ((tempnode1 = tempnode1.NextVisibleNode) != null);

```

I am not able to handle the null reference returned by this statement at the last node of the treeview. Can anyone please suggest a statement to check for null returned by TreeNode.NextVisibleNode

Thanks.