# NullPointerException while trying to readAsync properties for tags with empty names

**URL:** <https://forum.inductiveautomation.com/t/nullpointerexception-while-trying-to-readasync-properties-for-tags-with-empty-names/70590>\
**Category:** Module Development\
**Tags:** ignition81\
**Created:** [March 3, 2023, 2:36pm UTC](https://forum.inductiveautomation.com/t/nullpointerexception-while-trying-to-readasync-properties-for-tags-with-empty-names/70590 "2023-03-03T14:36:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![marius.oancea](https://avatars.discourse-cdn.com/v4/letter/m/9fc29f/32.png) [@marius.oancea](https://forum.inductiveautomation.com/u/marius.oancea)\
**Post date:** [March 3, 2023, 2:36pm UTC](https://forum.inductiveautomation.com/t/nullpointerexception-while-trying-to-readasync-properties-for-tags-with-empty-names/70590/1 "2023-03-03T14:36:11Z")

</div>

I'm reading the tag properties in batches using `tagManager.readAsync(propertyPaths)`.  
The problem is that one of the tag has empty name and the whole readAsync fails because of that with:

```auto
java.lang.NullPointerException: null
	at com.inductiveautomation.ignition.gateway.tags.model.impl.GatewayTagManagerImpl.lambda$readAsync$9(GatewayTagManagerImpl.java:730)
	at java.base/java.util.stream.MatchOps$1MatchSink.accept(Unknown Source)
	at java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(Unknown Source)
	at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source)
	at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source)
	at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
	at java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(Unknown Source)
	at java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(Unknown Source)
	at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
	at java.base/java.util.stream.ReferencePipeline.allMatch(Unknown Source)
	at com.inductiveautomation.ignition.gateway.tags.model.impl.GatewayTagManagerImpl.readAsync(GatewayTagManagerImpl.java:730)
	at com.inductiveautomation.ignition.common.tags.model.TagManager.readAsync(TagManager.java:62)

```

The structure looks like:

```auto
"Node 1"
  "Node 11"
    "" <-- boolean TAG with empty name
    "Tag 112"
    "Tag 113"
    "Tag 114"

```

We are using Ignition 8.1.16 but it seems the problem is reproducible also on older version like ignition 8.1.2.

Note: I do not know how the tag with empty name was created. I'm not able to create one using the UI.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [March 3, 2023, 2:45pm UTC](https://forum.inductiveautomation.com/t/nullpointerexception-while-trying-to-readasync-properties-for-tags-with-empty-names/70590/2 "2023-03-03T14:45:27Z")

</div>

Hmm, the line numbers don't match the latest version, but it looks like this would happen if one of the `TagPath`s you provided to the call was `null`, not just an empty name.

---

<div class="post-metadata">

**Author:** ![marius.oancea](https://avatars.discourse-cdn.com/v4/letter/m/9fc29f/32.png) [@marius.oancea](https://forum.inductiveautomation.com/u/marius.oancea)\
**Post date:** [March 3, 2023, 2:50pm UTC](https://forum.inductiveautomation.com/t/nullpointerexception-while-trying-to-readasync-properties-for-tags-with-empty-names/70590/3 "2023-03-03T14:50:57Z")

</div>

Just the name was empty. The path looks like:  
[XYZ]Main/Shear 3/MODE AND TIME/

for other paths like:  
[XYZ]Main/Shear 3/MODE AND TIME/ABC it works.
