diff --git a/src/core/js/edit_mode.js b/src/core/js/edit_mode.js
index 4659f92c3e4017080f9f64050a79b3672a3b7e05..d2b8fbcfa9fb31f9ccdc076c844f944ba0c04834 100644
--- a/src/core/js/edit_mode.js
+++ b/src/core/js/edit_mode.js
@@ -1024,7 +1024,7 @@ var edit_mode = new function () {
                     result.empty();
                     result.append(select);
                     // value=NA means that the first element is the warning that not all entities are provided
-                    if (_options[0].getAttribute('value') == "NA") {
+                    if (_options.length > 0 && _options[0].getAttribute('value') == "NA") {
                         // The button to show the input field for manual ID insertion
                         var manualInsertButton = $('<button title="Insert Entity Id manually." class="btn btn-link caosdb-update-entity-button caosdb-f-list-item-button"><i class="bi-pencil"></i></button>');
                         $(manualInsertButton).click(function () {