Skip to content

fix: handle null table container#5218

Open
biubiukam wants to merge 2 commits into
VisActor:developfrom
biubiukam:fix/issue-5217-null-container
Open

fix: handle null table container#5218
biubiukam wants to merge 2 commits into
VisActor:developfrom
biubiukam:fix/issue-5217-null-container

Conversation

@biubiukam

Copy link
Copy Markdown
Contributor

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Refactoring
  • Update dependency
  • Code style optimization
  • Test Case
  • Branch merge
  • Site / documentation update
  • Demo update
  • Workflow
  • Chore
  • Release
  • Other (about what?)

🔗 Related issue link

fix #5217

💡 Background and solution

When ListTable is constructed with a null container, BaseTable treats the first argument as constructor options and reads container.container before the existing validation runs. This causes an unhandled null-reference error instead of the intended container validation error.

This change only treats a truthy non-HTMLElement first argument as the options overload. An explicit null container now reaches the existing validation and throws vtable's container is undefined.

A regression test covers the null-container constructor path.

Validation:

  • node common/scripts/install-run-rush.js run -p @visactor/vtable -s compile
  • node common/scripts/install-run-rush.js test --only tag:package

📝 Changelog

Language Changelog
🇺🇸 English Throw a clear validation error when ListTable receives a null container.
🇨🇳 Chinese ListTable 接收到 null 容器时抛出明确的校验错误,避免空引用异常。

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

🚀 Summary

copilot:summary

🔍 Walkthrough

copilot:walkthrough

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] ListTable 未校验 container 为 null,导致空引用异常

1 participant