Skip to content

Commit

Permalink
catch all invalid files for dotenv extract "Malformed \uxxxx encoding."
Browse files Browse the repository at this point in the history
  • Loading branch information
Haehnchen committed May 20, 2024
1 parent f1894f9 commit 9a800ae
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 9a800ae

Please sign in to comment.