FIX: ensures we have touches when starting pan event (#7435)

FIX: ensures we have touches when starting pan event (#7435)

diff --git a/app/assets/javascripts/discourse/mixins/pan-events.js.es6 b/app/assets/javascripts/discourse/mixins/pan-events.js.es6
index 423fb1c..2b4dc4d 100644
--- a/app/assets/javascripts/discourse/mixins/pan-events.js.es6
+++ b/app/assets/javascripts/discourse/mixins/pan-events.js.es6
@@ -24,7 +24,7 @@ export default Ember.Mixin.create({
   addTouchListeners($element) {
     if (this.site.mobileView) {
       $element
-        .on("touchstart", e => this._panStart(e.touches[0]))
+        .on("touchstart", e => e.touches && this._panStart(e.touches[0]))
         .on("touchmove", e => {
           const touchEvent = e.touches[0];
           touchEvent.type = "pointermove";

GitHub sha: e386fa76

1 Like