| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 4deb43f commit 0ccbaf9
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -126,7 +126,11 @@ private String getPackageType(File folder) { | |||
| 126 | 126 | } | |
| 127 | 127 | try { | |
| 128 | 128 | BufferedReader reader = new BufferedReader(new FileReader(file)); | |
| 129 | - String result = new Gson().fromJson(reader, PackageJSON.class).type; | ||
| 129 | + PackageJSON pkgjson = new Gson().fromJson(reader, PackageJSON.class); | ||
| 130 | + if (pkgjson == null) { | ||
| 131 | + return null; | ||
| 132 | + } | ||
| 133 | + String result = pkgjson.type; | ||
| 130 | 134 | packageTypeCache.put(folder, Optional.ofNullable(result)); | |
| 131 | 135 | return result; | |
| 132 | 136 | } catch (IOException | JsonSyntaxException e) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,15 @@ | |||
| 1 | + #10000=@"/package.json;sourcefile" | ||
| 2 | + files(#10000,"/package.json","package","json",0) | ||
| 3 | + #10001=@"/;folder" | ||
| 4 | + folders(#10001,"/","") | ||
| 5 | + containerparent(#10001,#10000) | ||
| 6 | + #10002=@"loc,{#10000},0,0,0,0" | ||
| 7 | + locations_default(#10002,#10000,0,0,0,0) | ||
| 8 | + hasLocation(#10000,#10002) | ||
| 9 | + #20000=* | ||
| 10 | + json_errors(#20000,"Error: Unexpected token") | ||
| 11 | + #20001=@"loc,{#10000},1,1,1,1" | ||
| 12 | + locations_default(#20001,#10000,1,1,1,1) | ||
| 13 | + hasLocation(#20000,#20001) | ||
| 14 | + numlines(#10000,0,0,0) | ||
| 15 | + filetype(#10000,"json") | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,28 @@ | |||
| 1 | + #10000=@"/tst.js;sourcefile" | ||
| 2 | + files(#10000,"/tst.js","tst","js",0) | ||
| 3 | + #10001=@"/;folder" | ||
| 4 | + folders(#10001,"/","") | ||
| 5 | + containerparent(#10001,#10000) | ||
| 6 | + #10002=@"loc,{#10000},0,0,0,0" | ||
| 7 | + locations_default(#10002,#10000,0,0,0,0) | ||
| 8 | + hasLocation(#10000,#10002) | ||
| 9 | + #20000=@"global_scope" | ||
| 10 | + scopes(#20000,0) | ||
| 11 | + #20001=@"script;{#10000},1,1" | ||
| 12 | + numlines(#20001,0,0,0) | ||
| 13 | + #20002=* | ||
| 14 | + tokeninfo(#20002,0,#20001,0,"") | ||
| 15 | + #20003=@"loc,{#10000},1,1,1,0" | ||
| 16 | + locations_default(#20003,#10000,1,1,1,0) | ||
| 17 | + hasLocation(#20002,#20003) | ||
| 18 | + toplevels(#20001,0) | ||
| 19 | + hasLocation(#20001,#20003) | ||
| 20 | + #20004=* | ||
| 21 | + entry_cfg_node(#20004,#20001) | ||
| 22 | + hasLocation(#20004,#20003) | ||
| 23 | + #20005=* | ||
| 24 | + exit_cfg_node(#20005,#20001) | ||
| 25 | + hasLocation(#20005,#20003) | ||
| 26 | + successor(#20004,#20005) | ||
| 27 | + numlines(#10000,0,0,0) | ||
| 28 | + filetype(#10000,"javascript") | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments