fix for NPE in package

This commit is contained in:
Grahame Grieve 2022-06-13 21:40:04 +03:00
parent 513b84c306
commit 74e348f021
1 changed files with 6 additions and 3 deletions

View File

@ -1070,9 +1070,12 @@ public class NpmPackage {
for (String folder : folders.keySet()) {
NpmPackageFolder pf = folders.get(folder);
String p = folder.contains("$") ? path : Utilities.path(path, folder);
for (File f : new File(p).listFiles()) {
if (!f.isDirectory() && !isInternalExemptFile(f)) {
pf.getContent().put(f.getName(), TextFile.fileToBytes(f));
File file = new File(p);
if (file.exists()) {
for (File f : file.listFiles()) {
if (!f.isDirectory() && !isInternalExemptFile(f)) {
pf.getContent().put(f.getName(), TextFile.fileToBytes(f));
}
}
}
}