Skip to content

Commit

Permalink
fix NPE due to module names expressions being null
Browse files Browse the repository at this point in the history
The module name expressions can be null according to the javac docs.
  • Loading branch information
gayanper authored and datho7561 committed Jul 3, 2024
1 parent f4ef346 commit 27ed106
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,14 @@ private OpensDirective convert(JCOpens javac) {
res.setName(toName(javac.getPackageName()));
commonSettings(res, javac);
List<JCExpression> mods = javac.getModuleNames();
Iterator<JCExpression> it = mods.iterator();
while(it.hasNext()) {
JCExpression jcpe = it.next();
Expression e = convertExpression(jcpe);
if( e != null )
res.modules().add(e);
if (mods != null) {
Iterator<JCExpression> it = mods.iterator();
while (it.hasNext()) {
JCExpression jcpe = it.next();
Expression e = convertExpression(jcpe);
if (e != null)
res.modules().add(e);
}
}
return res;
}
Expand Down

0 comments on commit 27ed106

Please sign in to comment.