diff --git a/src/rendering/terrain-layer-material.ts b/src/rendering/terrain-layer-material.ts index d6607c2a..3e4f6c15 100644 --- a/src/rendering/terrain-layer-material.ts +++ b/src/rendering/terrain-layer-material.ts @@ -62,11 +62,11 @@ export function getFallbackTerrainLayerTexture(): Texture { export function getTerrainLayerTexture( material: MaterialDef | null, - textureLookup: (material: MaterialDef) => Texture + textureLookup: (material: MaterialDef) => Texture | null ): Texture { return material === null ? getFallbackTerrainLayerTexture() - : textureLookup(material); + : (textureLookup(material) ?? getFallbackTerrainLayerTexture()); } export function getTerrainLayerPreviewColor(material: MaterialDef | null): number {