Skip to content

Commit

Permalink
Merge pull request #2378 from Haehnchen/feature/invalid-virtual-file-env
Browse files Browse the repository at this point in the history
catch all invalid files for dotenv extract "Malformed \uxxxx encoding."
  • Loading branch information
Haehnchen committed May 20, 2024
2 parents 149255e + 9a800ae commit 4daa856
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,20 +115,20 @@ private static void visitEnvironment(@NotNull Project project, @NotNull Consumer

for (VirtualFile virtualFile : files) {
PsiFile file = PsiManager.getInstance(project).findFile(virtualFile);
if(file == null) {
if (file == null) {
continue;
}

Properties variables = new Properties();
try {
variables.load(virtualFile.getInputStream());
} catch (IOException e) {
} catch (Throwable e) {
continue;
}

for (Map.Entry<Object, Object> variable : variables.entrySet()) {
Object key = variable.getKey();
if(key instanceof String) {
if (key instanceof String) {
consumer.accept(Pair.create((String) key, file));
}
}
Expand Down

0 comments on commit 4daa856

Please sign in to comment.