Skip to content

Commit

Permalink
fix issue when webpack entrypoint config has a non string value for file
Browse files Browse the repository at this point in the history
  • Loading branch information
Haehnchen committed Aug 12, 2023
1 parent 962cdcb commit 73fe4a5
Showing 1 changed file with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,21 +126,19 @@ public void visitElement(@NotNull PsiElement element) {
String name = ((JSReferenceExpression) methodExpression).getReferenceName();
if ("addStyleEntry".equals(name) || "addEntry".equals(name)) {
JSExpression[] arguments = ((JSCallExpression) element).getArguments();
if (arguments.length >= 1) {
if (arguments[0] instanceof JSLiteralExpression) {
String parameter1 = ((JSLiteralExpression) arguments[0]).getStringValue();
String parameter2 = null;

if (StringUtils.isNotBlank(parameter1)) {
if (arguments.length >= 2) {
String parameter2Value = ((JSLiteralExpression) arguments[1]).getStringValue();
if (StringUtils.isNotBlank(parameter2Value)) {
parameter2 = parameter2Value;
}
if (arguments.length >= 1 && arguments[0] instanceof JSLiteralExpression jsLiteralExpressionArg0) {
String parameter1 = jsLiteralExpressionArg0.getStringValue();
String parameter2 = null;

if (StringUtils.isNotBlank(parameter1)) {
if (arguments.length >= 2 && arguments[1] instanceof JSLiteralExpression jsLiteralExpressionArg2) {
String parameter2Value = jsLiteralExpressionArg2.getStringValue();
if (StringUtils.isNotBlank(parameter2Value)) {
parameter2 = parameter2Value;
}

consumer.accept(new WebpackAsset(virtualFile, parameter1, parameter2, arguments[0]));
}

consumer.accept(new WebpackAsset(virtualFile, parameter1, parameter2, arguments[0]));
}
}
}
Expand Down

0 comments on commit 73fe4a5

Please sign in to comment.