FIX: Error when composer open doesn't return promise (#1)

FIX: Error when composer open doesn’t return promise (#1)

diff --git a/assets/javascripts/initializers/shared-edits-init.js.es6 b/assets/javascripts/initializers/shared-edits-init.js.es6
index 7bd040d..c96e073 100644
--- a/assets/javascripts/initializers/shared-edits-init.js.es6
+++ b/assets/javascripts/initializers/shared-edits-init.js.es6
@@ -138,11 +138,14 @@ function initWithApi(api) {
 
   api.modifyClass("controller:composer", {
     open(opts) {
-      return this._super(opts).then(() => {
-        if (opts.action === SHARED_EDIT_ACTION) {
-          setupSharedEdit(this.model);
-        }
-      });
+      const openResponse = this._super(opts);
+      if (openResponse && openResponse.then) {
+        return openResponse.then(() => {
+          if (opts.action === SHARED_EDIT_ACTION) {
+            setupSharedEdit(this.model);
+          }
+        });
+      }
     },
 
     collapse() {

GitHub sha: 74e8e61c

This commit appears in #1 which was merged by markvanlan.