Skip to content

Commit

Permalink
Add check for invalid terrain icon sources
Browse files Browse the repository at this point in the history
  • Loading branch information
Portponky committed Jan 14, 2024
1 parent 4e83eb5 commit 4b9e6ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/better-terrain/editor/TerrainEntry.gd
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func update():
_terrain_texture = null
terrain_icon_slot.queue_redraw()
has_icon = true
elif terrain.icon.has("source_id"):
elif terrain.icon.has("source_id") and tileset.has_source(terrain.icon.source_id):
var source := tileset.get_source(terrain.icon.source_id) as TileSetAtlasSource
var coord := terrain.icon.coord as Vector2i
var rect := source.get_tile_texture_region(coord, 0)
Expand Down

0 comments on commit 4b9e6ed

Please sign in to comment.