diff --git a/apps/webservice/src/app/[workspaceSlug]/_components/release-condition/useReleaseFilter.ts b/apps/webservice/src/app/[workspaceSlug]/_components/release-condition/useReleaseFilter.ts index 60c3b9bc..4c913918 100644 --- a/apps/webservice/src/app/[workspaceSlug]/_components/release-condition/useReleaseFilter.ts +++ b/apps/webservice/src/app/[workspaceSlug]/_components/release-condition/useReleaseFilter.ts @@ -10,7 +10,11 @@ export const useReleaseFilter = () => { const filter = useMemo(() => { const filterJson = urlParams.get("filter"); if (filterJson == null) return undefined; - return JSON.parse(LZString.decompressFromEncodedURIComponent(filterJson)); + try { + return JSON.parse(LZString.decompressFromEncodedURIComponent(filterJson)); + } catch { + return undefined; + } }, [urlParams]); const setFilter = useCallback( diff --git a/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/useTargetFilter.ts b/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/useTargetFilter.ts index d91c4590..fc0751be 100644 --- a/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/useTargetFilter.ts +++ b/apps/webservice/src/app/[workspaceSlug]/_components/target-condition/useTargetFilter.ts @@ -11,7 +11,11 @@ export const useTargetFilter = () => { const filter = useMemo(() => { const filterJson = urlParams.get("filter"); if (filterJson == null) return undefined; - return JSON.parse(LZString.decompressFromEncodedURIComponent(filterJson)); + try { + return JSON.parse(LZString.decompressFromEncodedURIComponent(filterJson)); + } catch { + return undefined; + } }, [urlParams]); const setFilter = useCallback(