Skip to content

armgit / mwmbl

Public Imported from GitHub
0

An open source, non-profit web search engine

Check we have some elements before creating a sortable

Daoud Clarke5c29792d14c0
diff --git a/front-end/src/components/organisms/results.js b/front-end/src/components/organisms/results.js
index 6c62d77..f2d2e9c 100644
--- a/front-end/src/components/organisms/results.js
+++ b/front-end/src/components/organisms/results.js
@@ -112,11 +112,12 @@ class ResultsHandler {
__initializeResults() {
this.results = document.querySelector('.results');
- const sortable = new Sortable(this.results, {
- "onStart": this.__sortableActivate.bind(this),
- "onEnd": this.__sortableDeactivate.bind(this),
- // "forceFallback": true,
- });
+ if (this.results) {
+ const sortable = new Sortable(this.results, {
+ "onStart": this.__sortableActivate.bind(this),
+ "onEnd": this.__sortableDeactivate.bind(this),
+ });
+ }
this.curating = false;
}