Skip to content

Commit ec1b8d6

Browse files
AMBARI-26568: Fixing IllegalArgumentException: argument src is null during schema upgrade (#4100)
1 parent e92b1fe commit ec1b8d6

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

ambari-server/src/main/java/org/apache/ambari/server/stack/ThemeModule.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ public ThemeModule(File themeFile, ThemeInfo moduleInfo) {
5858
try {
5959
reader = new FileReader(themeFile);
6060
} catch (FileNotFoundException e) {
61-
LOG.error("Theme file not found");
61+
LOG.error("Theme file not found: {}", themeFile.getAbsolutePath());
62+
setValid(false);
63+
addError("Theme file not found: " + themeFile.getAbsolutePath());
64+
return;
6265
}
6366
try {
6467
Theme theme = mapper.readValue(reader, Theme.class);
@@ -70,6 +73,14 @@ public ThemeModule(File themeFile, ThemeInfo moduleInfo) {
7073
LOG.error("Unable to parse theme file ", e);
7174
setValid(false);
7275
addError("Unable to parse theme file " + themeFile);
76+
} finally {
77+
if (reader != null) {
78+
try {
79+
reader.close();
80+
} catch (IOException e) {
81+
LOG.warn("Failed to close theme file reader", e);
82+
}
83+
}
7384
}
7485
}
7586
}

0 commit comments

Comments
 (0)