Skip to content

Commit

Permalink
Add file read error warning 'Invalid JSON syntax'
Browse files Browse the repository at this point in the history
  • Loading branch information
ArKaNeMaN committed Mar 13, 2021
1 parent 99ec6bc commit ee99edc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CustomWeaponsAPI.sma
Expand Up @@ -886,6 +886,10 @@ LoadWeapons(){

format(File, charsmax(File), "%s%s", Path, File);
Item = json_parse(File, true, true);
if(Item == Invalid_JSON){
log_amx("[WARNING] Invalid JSON syntax. File '%s'.", File);
continue;
}

if(!json_is_object(Item)){
json_free(Item);
Expand Down

0 comments on commit ee99edc

Please sign in to comment.