Skip to content

Commit

Permalink
Add guard for undefined window
Browse files Browse the repository at this point in the history
  • Loading branch information
brianlove committed Mar 8, 2024
1 parent d637015 commit 41f7de8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion github-metrics/src/pages/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const Project = () => {
export default Project;

export function Head() {
const urlParams = new URLSearchParams(window.location.search);
const urlParams = new URLSearchParams((typeof window !== "undefined") ? window.location.search : "");
const projectName = urlParams.get("name") ?? undefined;

return (
Expand Down

0 comments on commit 41f7de8

Please sign in to comment.