Don't try to load the shader code if the file couldn't be opened
This commit is contained in:
parent
4d12ad4432
commit
7b72274140
1 changed files with 6 additions and 5 deletions
|
@ -61,6 +61,7 @@ func save_result(path: String):
|
|||
func load_shader(path: String):
|
||||
print("Load ", path)
|
||||
var file = FileAccess.open(path, FileAccess.READ)
|
||||
if file != null:
|
||||
self.shader_code = file.get_as_text()
|
||||
if "/" in path: # update current working directory
|
||||
self.cwd = path.substr(0, path.rfind("/"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue