Skip to content

Commit

Permalink
fix: OmegaT failed to start when malformed jar in plugin folder (#1196)
Browse files Browse the repository at this point in the history
- Fix BUGS#1276 OmegaT failed to start if there are 'jar' file w/o manifest in plugin folder

Signed-off-by: Hiroshi Miura <[email protected]>
  • Loading branch information
miurahr authored Nov 24, 2024
1 parent 4a568b0 commit f502f3f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/org/omegat/filters2/master/PluginUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,10 @@ protected static List<URL> populatePluginUrlList(List<File> pluginsDirs) {
for (URL url : urlList) {
try (JarInputStream jarStream = new JarInputStream(url.openStream())) {
Manifest mf = jarStream.getManifest();
if (mf == null) {
// mf can be null when a jar file does not have a manifest.
continue;
}
String pluginClass = mf.getMainAttributes().getValue(OMEGAT_PLUGINS);
String oldPluginClass = mf.getMainAttributes().getValue(OMEGAT_PLUGIN);

Expand Down

0 comments on commit f502f3f

Please sign in to comment.