issue 34 - npe reading npm without canonical
This commit is contained in:
parent
74cfa3efcc
commit
c3a0958c94
|
@ -271,7 +271,7 @@ import com.google.gson.JsonObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String canonical() {
|
public String canonical() {
|
||||||
return npm.get("canonical").getAsString();
|
return npm.has("canonical") ? npm.get("canonical").getAsString() : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -245,6 +245,9 @@ public class PackageCacheManager {
|
||||||
|
|
||||||
|
|
||||||
public void recordMap(String url, String id) throws IOException {
|
public void recordMap(String url, String id) throws IOException {
|
||||||
|
if (url == null)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!(new File(Utilities.path(cacheFolder, "packages.ini")).exists()))
|
if (!(new File(Utilities.path(cacheFolder, "packages.ini")).exists()))
|
||||||
throw new Error("File "+Utilities.path(cacheFolder, "packages.ini")+" not found #1");
|
throw new Error("File "+Utilities.path(cacheFolder, "packages.ini")+" not found #1");
|
||||||
IniFile ini = new IniFile(Utilities.path(cacheFolder, "packages.ini"));
|
IniFile ini = new IniFile(Utilities.path(cacheFolder, "packages.ini"));
|
||||||
|
|
Loading…
Reference in New Issue