Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

Revert "fix: gracefully handle missing EditorContainer during project creation"

esenginee16ed5705a17
diff --git a/editor/src/schemas/ComponentSchemas.ts b/editor/src/schemas/ComponentSchemas.ts
index 273401564..ef1a9b7fa 100644
--- a/editor/src/schemas/ComponentSchemas.ts
+++ b/editor/src/schemas/ComponentSchemas.ts
@@ -266,14 +266,10 @@ export function getDefaultComponentData(typeName: string): Record<string, unknow
export function getInitialComponentData(typeName: string): Record<string, unknown> {
const defaults = getDefaultComponentData(typeName);
- try {
- const schema = getEditorContainer().get(COMPONENT_SCHEMA, typeName);
- const overrides = schema?.editorDefaults?.();
- if (overrides) {
- return { ...defaults, ...overrides };
- }
- } catch {
- // EditorContainer may not be initialized yet (e.g. during project creation from launcher)
+ const schema = getEditorContainer().get(COMPONENT_SCHEMA, typeName);
+ const overrides = schema?.editorDefaults?.();
+ if (overrides) {
+ return { ...defaults, ...overrides };
}
return defaults;
}