diff --git a/InvenTree/part/templates/part/import_wizard/part_upload.html b/InvenTree/part/templates/part/import_wizard/part_upload.html
index 1e9e043868..1f69a3b7be 100644
--- a/InvenTree/part/templates/part/import_wizard/part_upload.html
+++ b/InvenTree/part/templates/part/import_wizard/part_upload.html
@@ -4,7 +4,7 @@
{% load static %}
{% block sidebar %}
-{% url 'part-index' as url %]
+{% url 'part-index' as url %}
{% include "sidebar_link.html" with url=url text="Return to Parts" icon="fa-undo" %}
{% endblock %}
diff --git a/InvenTree/templates/js/dynamic/nav.js b/InvenTree/templates/js/dynamic/nav.js
index 7554b6418d..043b889da1 100644
--- a/InvenTree/templates/js/dynamic/nav.js
+++ b/InvenTree/templates/js/dynamic/nav.js
@@ -113,10 +113,11 @@ function enableSidebar(label, options={}) {
} else {
// Find the "first" available panel (according to the sidebar)
var selector = $('.sidebar-selector').first();
-
- var panel_name = selector.attr('id').replace('select-', '');
-
- activatePanel(label, panel_name);
+
+ if (selector.exists()) {
+ var panel_name = selector.attr('id').replace('select-', '');
+ activatePanel(label, panel_name);
+ }
}
if (options.hide_toggle) {
diff --git a/InvenTree/templates/sidebar_link.html b/InvenTree/templates/sidebar_link.html
index 8141366004..6379c129c2 100644
--- a/InvenTree/templates/sidebar_link.html
+++ b/InvenTree/templates/sidebar_link.html
@@ -1,4 +1,4 @@
{% load i18n %}
-