# NullPointerException Error

**URL:** <https://forum.inductiveautomation.com/t/nullpointerexception-error/34713>\
**Category:** Ignition\
**Created:** [May 13, 2020, 7:11pm UTC](https://forum.inductiveautomation.com/t/nullpointerexception-error/34713 "2020-05-13T19:11:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wattersm](https://avatars.discourse-cdn.com/v4/letter/w/50afbb/32.png) [@wattersm](https://forum.inductiveautomation.com/u/wattersm)\
**Post date:** [May 13, 2020, 7:11pm UTC](https://forum.inductiveautomation.com/t/nullpointerexception-error/34713/1 "2020-05-13T19:11:12Z")

</div>

I am attempting to build a navigation menu however I’m getting a NullPointerException thrown by java whenever I select an item in the menu. For example, here is the traceback.

```auto
Traceback (most recent call last):

  File "<event:mouseClicked>", line 8, in <module>

java.lang.NullPointerException: java.lang.NullPointerException

	caused by NullPointerException

Ignition v7.9.13 (b2019120915)
Java: Oracle Corporation 1.8.0_251

```

The script I am using was lifted directly from the example project template. Here is the code.

```auto
if event.clickCount == 2:
	row = event.source.selectedItem
	data = event.source.data
	if row != -1:
		# Grab the window path value out of the tree view's items dataset
		windowPath = data.getValueAt(row, "windowPath")
		system.gui.messageBox(windowPath)
		#system.nav.swapTo(windowPath)

```

The system.gui.messageBox(windowPath) shows that windowPath is not being set. Is there a way to resolve this?

---

<div class="post-metadata">

**Author:** ![wattersm](https://avatars.discourse-cdn.com/v4/letter/w/50afbb/32.png) [@wattersm](https://forum.inductiveautomation.com/u/wattersm)\
**Post date:** [May 13, 2020, 7:31pm UTC](https://forum.inductiveautomation.com/t/nullpointerexception-error/34713/2 "2020-05-13T19:31:23Z")

</div>

Got it working. Apparently double clicking on the menu tree does _not_ take you to the proper location, you need to use the Items properly instead. Are there any plans to make menu creation easier? Manually setting window paths in a data set is a bit of a pain when they are already defined in the designer.
