Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix: crash when adding tag with undefined fields

thecodrrc94c9528d838
diff --git a/apps/web/src/components/editor/header.js b/apps/web/src/components/editor/header.js
index bf96eb3f2..76e5e116b 100644
--- a/apps/web/src/components/editor/header.js
+++ b/apps/web/src/components/editor/header.js
@@ -3,7 +3,7 @@ import TitleBox from "./title-box";
import { useStore } from "../../stores/editor-store";
import { Input } from "@rebass/forms";
import * as Icon from "../icons";
-import { Box, Button, Flex, Text } from "rebass";
+import { Button, Flex, Text } from "rebass";
import IconTag from "../icon-tag";
import { db } from "../../common/db";
@@ -125,7 +125,7 @@ function Autosuggest({
fields.some((field) => {
return (
field
- .normalize("NFD")
+ ?.normalize("NFD")
.replace(/[\u0300-\u036f]/g, "")
.toLowerCase()
.indexOf(value.toLowerCase()) !== -1