Skip to content

Commit

Permalink
fix: Attempting to split undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
tommoor committed Dec 31, 2024
1 parent 6ca3c25 commit adfca1e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions shared/editor/components/FileExtension.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ import { s } from "../../styles";
import { stringToColor } from "../../utils/color";

type Props = {
title: string;
/** The title of the file */
title?: string;
/** The size of the icon */
size?: number;
};

export default function FileExtension(props: Props) {
const parts = props.title.split(".");
const parts = (props.title ?? "Unknown").split(".");
const extension = parts.length > 1 ? parts.pop() : undefined;

return (
Expand Down

0 comments on commit adfca1e

Please sign in to comment.