Skip to content

Commit

Permalink
fix: potential null ref when reloading components (#4228)
Browse files Browse the repository at this point in the history
  • Loading branch information
hacke2 authored Dec 16, 2024
1 parent ca15b4c commit ec675f6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/core-browser/src/components/resize/resize.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -568,8 +568,11 @@ export const ResizeHandleVertical = (props: ResizeHandleProps) => {

// keep = true 左右侧面板使用,保证相邻节点的总宽度不变
const setAbsoluteSize = (size: number, isLatter?: boolean, keep?: boolean) => {
const currentPrev = prevElement.current!.clientHeight;
const currentNext = nextElement.current!.clientHeight;
if (!prevElement.current || !nextElement.current) {
return;
}
const currentPrev = prevElement.current.clientHeight;
const currentNext = nextElement.current.clientHeight;
const totalSize = currentPrev + currentNext;
if (props.flexMode) {
const prevHeight = props.flexMode === ResizeFlexMode.Prev ? size : totalSize - size;
Expand Down

0 comments on commit ec675f6

Please sign in to comment.