We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a61c17f commit a18fd4aCopy full SHA for a18fd4a
Source/Scripts/File.gd
@@ -5,7 +5,11 @@ static func read(path:String)->String:
5
6
## Reads the file as a UTF-8 string and parses a JSON element.
7
static func read_json(path:String)->Variant:
8
- return JSON.parse_string(read(path))
+ var text:String = read(path)
9
+ if text.is_empty():
10
+ return null
11
+ #end
12
+ return JSON.parse_string(text)
13
#end
14
15
## Writes the UTF-8 string to the file.
0 commit comments