Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: potential null ref when reloading components #4228

Merged
merged 2 commits into from
Dec 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading