mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-15 08:18:55 +00:00
[#1304] Catch exception in call to getBaseURL()
The call causes a MissingResourceException, since EMF does not find a plugin.properties in xtext.utils. Fixes the regression that arised from Xtend to Java refactoring. The old code catched the exception and returned null. Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
This commit is contained in:
parent
e1161dbe03
commit
85510e8157
1 changed files with 6 additions and 1 deletions
|
@ -93,7 +93,12 @@ public class XtextVersion {
|
|||
}
|
||||
|
||||
private static String readVersionFromManifest() {
|
||||
URL baseURL = XtextVersion.Plugin.INSTANCE.getBaseURL();
|
||||
URL baseURL = null;
|
||||
try {
|
||||
baseURL = XtextVersion.Plugin.INSTANCE.getBaseURL();
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
try (InputStream is = new URL (baseURL + "META-INF/MANIFEST.MF").openStream()) {
|
||||
Manifest manifest = new Manifest(is);
|
||||
String version = manifest.getMainAttributes().getValue("Maven-Version");
|
||||
|
|
Loading…
Reference in a new issue