From c9c23a633d5d7f89227beaa70edf714af109143d Mon Sep 17 00:00:00 2001 From: Disconnect3d Date: Thu, 4 Sep 2025 14:36:08 +0200 Subject: [PATCH] Fix typeof check for location variable The `typeof` operator returns a string, so a comparison of its result should always be performed against a string, not a constant like `undefined`. In other words: `typeof sth != undefined` should be `typeod sth != "undefined"` (or even use !==, but I'll leave it as `!=` in here). --- webapp/src/pages/[resourceSlug]/task/add.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/src/pages/[resourceSlug]/task/add.tsx b/webapp/src/pages/[resourceSlug]/task/add.tsx index e6ef2c91a..e8a9ad702 100644 --- a/webapp/src/pages/[resourceSlug]/task/add.tsx +++ b/webapp/src/pages/[resourceSlug]/task/add.tsx @@ -30,7 +30,7 @@ export default function AddTask(props) { }, [resourceSlug]); useEffect(() => { - if (typeof location != undefined) { + if (typeof location != "undefined") { const taskId = new URLSearchParams(location.search).get('taskId'); if (taskId) { fetchEditData(taskId);