Skip to content

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

fix: crashes due to toTitleCase being empty

thecodrr926a09eab794
diff --git a/apps/web/src/utils/string.js b/apps/web/src/utils/string.js
index d22327fec..6488610ee 100644
--- a/apps/web/src/utils/string.js
+++ b/apps/web/src/utils/string.js
@@ -1,4 +1,10 @@
+import { captureMessage } from "@sentry/react";
+
export function toTitleCase(str) {
+ if (!str) {
+ captureMessage("str is empty in toTitleCase");
+ return "";
+ }
return str[0].toUpperCase() + str.substring(1);
}