fix(credits): crash if text file not found

This commit is contained in:
2025-11-05 23:50:19 +01:00
parent eca4cc1d7b
commit f86bebd7ca
3 changed files with 6 additions and 6 deletions

View File

@@ -2,9 +2,7 @@
@abstract class_name BaseTextPlainFormatLoader
extends ResourceFormatLoader
const ResourceClass = preload(
"res://addons/escoria-ui-return-monkey-island/resources/text_plain_resource.gd"
)
const ResourceClass = preload("res://addons/escoria-ui-return-monkey-island/resources/text_plain_resource.gd")
@abstract func get_recognized_extensions() -> Array
@@ -29,8 +27,8 @@ func _load(path: String, _original_path: String, _use_sub_threads: bool, _cache_
var res := TextPlainResource.new()
var file = FileAccess.open(path, FileAccess.READ)
if file != null:
res.text = file.get_as_text()
file.close()
res.text = file.get_as_text()
file.close()
return res

View File

@@ -0,0 +1 @@
uid://d2li01uugchuf

View File

@@ -0,0 +1 @@
uid://cbo8cu5dysixb