From 11c7cf11355ff9d3cdec4faa2b93accde1a7b490 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 6 Aug 2019 21:54:48 +0200 Subject: [PATCH] Fixed issue with window not being present on intialisation When using webpack and web workers hammerjs can receive an undefined window and document, this if statement blocks it from running unless those objects are present. --- hammer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hammer.js b/hammer.js index 5ea778100..ce499d112 100644 --- a/hammer.js +++ b/hammer.js @@ -3,7 +3,7 @@ * * Copyright (c) Jorik Tangelder; * Licensed under the MIT license */ -(function(window, document, exportName, undefined) { +if( typeof window !== "undefined" && typeof document !== "undefined" )(function(window, document, exportName, undefined) { 'use strict'; /** * @private