Skip to content

Commit

Permalink
fix: add optional chaining
Browse files Browse the repository at this point in the history
  • Loading branch information
abdou6666 committed Feb 11, 2025
1 parent b5287b1 commit 5e6f867
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions frontend/src/components/visual-editor/v2/Diagrams.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file).
*/


import { Add, ContentCopyRounded, MoveUp } from "@mui/icons-material";
import DeleteIcon from "@mui/icons-material/Delete";
import EditIcon from "@mui/icons-material/Edit";
Expand Down Expand Up @@ -52,7 +51,7 @@ import { useSearch } from "@/hooks/useSearch";
import { useToast } from "@/hooks/useToast";
import { useTranslate } from "@/hooks/useTranslate";
import { EntityType, Format, QueryType, RouterType } from "@/services/types";
import { IBlock, IBlockStub } from "@/types/block.types";
import { IBlock } from "@/types/block.types";
import { BlockPorts } from "@/types/visual-editor.types";

import { BlockEditFormDialog } from "../BlockEditFormDialog";
Expand Down Expand Up @@ -199,7 +198,7 @@ const Diagrams = () => {
);
const handleDuplicateBlock = () => {
const selectedBlock = selectedBlocks[0] as any;
const block = getBlockFromCache(selectedBlock.options.id) as IBlockStub;
const block = getBlockFromCache(selectedBlock?.options?.id);

if (!block) {
return;
Expand Down

0 comments on commit 5e6f867

Please sign in to comment.