From dc0d141cd6bf1394f20e91e2f412b70e32f1ca74 Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Tue, 24 Aug 2021 14:43:34 +0200 Subject: [PATCH] chore(http-client): check if length is zero --- frontend/src/services/http-client/http-client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/services/http-client/http-client.js b/frontend/src/services/http-client/http-client.js index 34fba00dc..81f72485e 100644 --- a/frontend/src/services/http-client/http-client.js +++ b/frontend/src/services/http-client/http-client.js @@ -21,7 +21,7 @@ export class HttpClient { if (typeof interceptor !== 'function') { throw new Error(`Cannot remove Interceptor ${interceptor}, because it is not of type function`); } - if(this._responseInterceptors.filter(el => el == interceptor).length !== 1) { + if(this._responseInterceptors.filter(el => el == interceptor).length === 0) { throw new Error(`Could not find Response Interceptor ${interceptor}.`); } this._responseInterceptors = this._responseInterceptors.filter(el => el !== interceptor);