Don't detach handler if it doesn't exist

If the beforeEach() step has been skipped then there won't be anything
here to detach.
This commit is contained in:
Pierre Ossman 2020-06-25 14:45:58 +02:00
parent 484a9551d1
commit 794b06b2bd
1 changed files with 3 additions and 1 deletions

View File

@ -40,7 +40,9 @@ describe('Gesture handler', function () {
}); });
afterEach(function () { afterEach(function () {
handler.detach(); if (handler) {
handler.detach();
}
target = null; target = null;
gestures = null; gestures = null;
}); });