auto-git:
[change] src/document/scene-document-validation.ts
This commit is contained in:
@@ -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];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user