diff --git a/resources/vue/mixins/courseware/container.js b/resources/vue/mixins/courseware/container.js
index de162f9d8f42f842d0fbe88b9df483ace457581e..ef09a8bd801cb4ac74ec99debdc9d0e2a88ec229 100644
--- a/resources/vue/mixins/courseware/container.js
+++ b/resources/vue/mixins/courseware/container.js
@@ -252,7 +252,7 @@ const containerMixin = {
         resetAdderStorage() {
             // choose the last container and its last section as the default adder slot
             // for adding blocks and containers via click
-            if (this.containers) {
+            if (this.containers && this.containers.length > 0) {
                 const lastContainer = this.containers[this.containers.length - 1];
                 const section = lastContainer.activeSection ?? 0;
                 this.setAdderStorage({