# TagHistoryProvider.browse NullPointerException?

**URL:** <https://forum.inductiveautomation.com/t/taghistoryprovider-browse-nullpointerexception/54804>\
**Category:** Module Development\
**Created:** [January 9, 2022, 3:22am UTC](https://forum.inductiveautomation.com/t/taghistoryprovider-browse-nullpointerexception/54804 "2022-01-09T03:22:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![TThorius](https://avatars.discourse-cdn.com/v4/letter/t/e9bcb4/32.png) [@TThorius](https://forum.inductiveautomation.com/u/TThorius)\
**Post date:** [January 9, 2022, 3:22am UTC](https://forum.inductiveautomation.com/t/taghistoryprovider-browse-nullpointerexception/54804/1 "2022-01-09T03:22:31Z")

</div>

Hi,

I’m trying to implement the TagHistoryProvider.browse function to return a set of root level “folders” that contains all the actual tags. Is there a good example on how to do this somewhere?

Here is what I was thinking that the root folder code should look like. If I debug the code, then I can see that it returns a valid Results Object with a valid list of results, but it gives me a runtime error (NullPointerException) when I try to browse from Perspective.

```auto
var result = new Results<Result>();
var list = new ArrayList<Result>();
var driver = path.getPathComponent(WellKnownPathTypes.Driver);
var histProv = qualifiedPath.getPathComponent(WellKnownPathTypes.HistoryProvider);

if (null == driver) {
  var assets = new TagResult();
  var p = new QualifiedPath.Builder()
               .setProvider(histProv)
               .setDriver("Assets") // Can we use driver here? (and is there a good explanation of tag parts somewhere?
               .build();
  assets.setHasChildren(true);
  assets.setPath(p);
  list.add(assets);
   ...
}
result.setResults(list);
return result;

```
