Check for JCefAppConfig.getVersion() presence

The method can be missing in the runtime JCEF lib, when older JBR is used.

GitOrigin-RevId: b82069e73a4c8a8ea958cdd4d9f64c625552db40
This commit is contained in:
Anton Tarasov
2020-05-13 14:37:53 +00:00
committed by intellij-monorepo-bot
parent e39f4aa9c8
commit 41f6e88b15
@@ -161,15 +161,21 @@ public final class JBCefApp {
Function<String, Boolean> unsupported = (msg) -> {
ourSupported = new AtomicBoolean(false);
if (logging) {
LOG.warn(msg);
LOG.warn(msg + (!msg.contains("disabled") ? " (Use JBR bundled with the IDE)" : ""));
}
return false;
};
// warn: do not change to Registry.is(), the method used at startup
if (!RegistryManager.getInstance().is("ide.browser.jcef.enabled")) {
return unsupported.apply("JCEF is disabled via 'ide.browser.jcef.enabled'");
return unsupported.apply("JCEF is manually disabled via 'ide.browser.jcef.enabled'");
}
String version;
try {
version = JCefAppConfig.getVersion();
}
catch (NoSuchMethodError e) {
return unsupported.apply("JCEF runtime version is not supported");
}
String version = JCefAppConfig.getVersion();
if (version == null) {
return unsupported.apply("JCEF runtime version is not available");
}