auto-git:

[change] src/document/scene-document-validation.ts
This commit is contained in:
2026-04-22 12:28:45 +02:00
parent 0404f7a848
commit 71d8a19f22

View File

@@ -191,7 +191,8 @@ function validateWorldBackgroundSettings(
document: SceneDocument | ProjectDocument, document: SceneDocument | ProjectDocument,
diagnostics: SceneDiagnostic[], diagnostics: SceneDiagnostic[],
path: string, path: string,
label: string label: string,
options: { allowEmptyImageAssetId?: boolean } = {}
) { ) {
if (background.mode === "solid") { if (background.mode === "solid") {
if (!isHexColorString(background.colorHex)) { if (!isHexColorString(background.colorHex)) {
@@ -238,6 +239,7 @@ function validateWorldBackgroundSettings(
typeof background.assetId !== "string" || typeof background.assetId !== "string" ||
background.assetId.trim().length === 0 background.assetId.trim().length === 0
) { ) {
if (!options.allowEmptyImageAssetId) {
diagnostics.push( diagnostics.push(
createDiagnostic( createDiagnostic(
"error", "error",
@@ -246,6 +248,7 @@ function validateWorldBackgroundSettings(
`${path}.assetId` `${path}.assetId`
) )
); );
}
} else { } else {
const backgroundAsset = document.assets[background.assetId]; const backgroundAsset = document.assets[background.assetId];