<template name="courseSidebarSection">
    <div class="panel panel-default ">
        <div class="panel-heading" id="section-title">{{ title }}</div>
        <div class="panel-body single-content-table-block">
            <ul class="nav nav-pills nav-stacked">
                {{# each lessons }}
                {{> sectionLesson }}
                {{/ each }}
            </ul>
        </div>
        {{# if editMode }}
        <div class="panel-footer">
            {{> sectionAddLesson }}
        </div>
        {{/ if }}
    </div>
</template>

<template name="courseSidebarSection">
    <div class="panel panel-default ">
        <div class="panel-heading" id="section-title">{{ title }}</div>
        <div class="panel-body single-content-table-block">
            <ul class="nav nav-pills nav-stacked">
                {{# if lessons }} <!-- Make sure there are lessons for looping -->
                {{# each lessons }} <!-- Loop through lessons -->
                {{> sectionLesson }}
                {{/ each }}
                {{/ if }}
            </ul>
        </div>
        {{# if editMode }}
        <div class="panel-footer">
            {{> sectionAddLesson }}
        </div>
        {{/ if }}
    </div>
</template>

Check for lessons before iterating.
Check for lessons before iterating.
