How to Fix Error "Attempt to modify property "children" on null"

On some older versions of OSMap, you may encounter the following error when opening your HTML sitemap:

Attempt to modify property "children" on null

The Attempt to modify property children on null error displayed on a Joomla site

This error can occur when OSMap processes the hierarchy of sitemap items and an external parent link has been excluded from the HTML sitemap.

First, make sure that you are running the latest version of OSMap. Recent versions include additional checks when building the HTML sitemap to prevent this error.

If you are unable to update OSMap immediately, you can also try allowing external links in the HTML sitemap:

  • Go to Components → OSMap in your Joomla administrator area.
  • Click Options in the toolbar.
  • Find the Show External Links setting.
  • Set it to Only in HTML Sitemap.
  • Click Save & Close.

The Show External Links parameter enabled for the HTML sitemap

You can also select Yes, but this will allow external links in both the HTML and XML sitemaps. If you only need to resolve the HTML sitemap issue, Only in HTML Sitemap is the better choice.