I use this code for my sub-nav links:

{{ if {pages:count from="/{segment_1}"} > 0 }}
  <nav id="sub-navigation" class="sub-navigation" role="navigation">
    <ul>
      <li><a {{ if segment_1 == slug }} class="current" {{ /if }} href="/{{ segment_1 }}">Overview</a></li>
      {{ pages from="/{segment_1}" depth="1" }}
        <li><a {{ if segment_2 == slug }} class="current" {{ /if }} href="{{ url }}">{{ title }}</a></li>
      {{ /pages }}
    </ul>
  </nav>
{{ /if }}

The use of the {{ pages }} tags causes the 404 template to error with this:

FatalThrowableError in PagesTags.php line 139:
Call to a member function children() on null

Is there a work-around for this?

Answered by Renée Nesseth! Go to answer.