Skip to content

Commit 0d4c0fc

Browse files
committed
fix(TMapObjectJSON): properly handling non existing json file
1 parent 9e36045 commit 0d4c0fc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

osrs/position/map/mapjson.simba

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ begin
2424
filename := PATH_SEP + ToStr(chunk.X) + '-' + ToStr(chunk.Y) + '.json';
2525
cachename := Map.Loader.CacheDir + 'objects' + PATH_SEP + ToStr(plane) + filename;
2626

27-
if FileExists(cachename) then
28-
begin
29-
Result := new TJSONParser();
30-
Result.Load(cachename);
31-
end;
27+
if not FileExists(cachename) then
28+
Exit(nil);
29+
30+
Result := new TJSONParser();
31+
Result.Load(cachename);
3232
end;
3333

3434
(*

0 commit comments

Comments
 (0)