Skip to content

Commit b99321a

Browse files
committed
fix: hard crash when bookmark "name" (now based on text snippet before/after caret) is undefined, from previously-created bookmarks
1 parent 30371b1 commit b99321a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/renderer/reader/components/ReaderMenu.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,13 @@ const renderLinkTree = (currentLocation: MiniLocatorExtended, isRTLfn: (_link: I
395395
return RenderLinkTree;
396396
};
397397

398-
const HardWrapComment: React.FC<{ comment: string }> = (props) => {
398+
const HardWrapComment: React.FC<{ comment: string | undefined }> = (props) => {
399399
const { comment } = props;
400+
if (!comment) {
401+
return (
402+
<p> </p>
403+
);
404+
}
400405
const splittedComment = comment.split("\n");
401406

402407
const strListComponent = [];

0 commit comments

Comments
 (0)