`mergeBufferGeometries` give error for empty array
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 42/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- threejs, typescript
调研方向
从 src/utils/BufferGeometryUtils.ts 中的 mergeBufferGeometries 开始,复现触发由 undefined 索引导致的 TypeError 的空数组调用。对比链接的 three.js upstream 实现,确定空输入的预期行为,并确保运行时行为和 TypeScript 签名一致地传达这一结果。
由索引模型根据 Issue 内容生成。
描述
threeversion: 0.160@types/threeversion:three-stdlibversion:
Problem description:
mergeBufferGeometries gives error Uncaught TypeError: Cannot read properties of undefined (reading 'index')
It is from some sloppy list access
which also exists in three.js upstream
Relevant code:
Suggested solution:
I generally would return some reasonable identity object for such cases than raising sloppy errors.
Maybe null can be reasonable.
Or otherwise, it may be useful to denote the types as [BufferGeometry, ...BufferGeometry[]] instead of BufferGeometry[],
where typescript can just warn users that users should pass array with at least one element.
- 主要语言
- JavaScript
- 星标
- 863
- 派生
- 146
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
pmndrs/three-stdlib 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 62/100
pmndrs/three-stdlib#423 ·
-
难度 4/5 3-5 天 新手友好度 58/100
pmndrs/three-stdlib#437 ·
-
bug
难度 4/5 3-5 天 新手友好度 42/100
pmndrs/three-stdlib#435 ·
-
OrbitControls touch crashes on Expo mobile app可能已有人在做 @adamistheanswer 于 132 天前认领。 未关闭bug
难度 3/5 1-2 天 新手友好度 68/100
pmndrs/three-stdlib#426 · 1 条评论 · 1 个 reaction ·
-
enhancement
难度 2/5 1-3 小时 新手友好度 45/100
pmndrs/three-stdlib#425 ·
查看 pmndrs/three-stdlib 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 85/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
vercel-labs/agent-skills#348 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
NanmiCoder/dsh-agent-teams#289 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 70/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 83/100
c1overzz/dsh-bili-scroll#124 ·
维护者通常 1 天内回复