{% set lowestTopChild = adminmenu.lowestTopChild %}
{% set navigationChildren = lowestTopChild.navigationChildren %}

{% if lowestTopChild and navigationChildren | length > 0 %}
    <aside class="sidebar">
        <div class="search_wrp">
            <form id="treeform">
        	    <input type="text" id="searchVal" value="" />
        	    <button id="search" class="btn search"><img src="/bundles/kunstmaanadmin/img/icons/search.png" alt="Search" /></button>
            </form>
        </div>
        <div id="tree" class="tree">
        	<ul>
                {% set currentMenuItem = adminmenu.current %}
                <li class="jstree-open {% if lowestTopChild.internalname == currentMenuItem.internalname %}active{% endif %}" {% if lowestTopChild.role %} rel="{{lowestTopChild.role}}" {% endif %}><a href="{{ path(lowestTopChild.route, lowestTopChild.routeparams) }}">{{ lowestTopChild.internalname | trans }}</a>
        	        <ul>
                		{% for menuitem in navigationChildren %}
                            {% include 'KunstmaanAdminBundle:Default:rectreeview.html.twig' %}
                        {% endfor %}
                    </ul>
            	</li>
            </ul>
        </div>
    </aside>
{% endif %}
{% set lowestTopChild = adminmenu.lowestTopChild %}
{% if lowestTopChild %}
    {% set navigationChildren = lowestTopChild.navigationChildren %}
{% endif %}

{% if lowestTopChild and navigationChildren | length > 0 %}
    <aside class="sidebar">
        <div class="search_wrp">
            <form id="treeform">
        	    <input type="text" id="searchVal" value="" />
        	    <button id="search" class="btn search"><img src="/bundles/kunstmaanadmin/img/icons/search.png" alt="Search" /></button>
            </form>
        </div>
        <div id="tree" class="tree">
        	<ul>
                {% set currentMenuItem = adminmenu.current %}
                <li class="jstree-open {% if lowestTopChild.internalname == currentMenuItem.internalname %}active{% endif %}" {% if lowestTopChild.role %} rel="{{lowestTopChild.role}}" {% endif %}><a href="{{ path(lowestTopChild.route, lowestTopChild.routeparams) }}">{{ lowestTopChild.internalname | trans }}</a>
        	        <ul>
                		{% for menuitem in navigationChildren %}
                            {% include 'KunstmaanAdminBundle:Default:rectreeview.html.twig' %}
                        {% endfor %}
                    </ul>
            	</li>
            </ul>
        </div>
    </aside>
{% endif %}

Fix when lowestTopChild does not exist
Fix when lowestTopChild does not exist
