Autoupdate should get the default white label from its jar filename. #6838

only:explicit error message
This commit is contained in:
Andrey 2024-09-18 11:38:24 -04:00
parent f25772dc7d
commit 38067cacc6
1 changed files with 5 additions and 5 deletions

View File

@ -50,11 +50,11 @@ public class ConnectionAndMeta {
String jarPath = jarUrl.getPath(); String jarPath = jarUrl.getPath();
String jarFileName = jarPath.substring(jarPath.lastIndexOf('/') + 1); String jarFileName = jarPath.substring(jarPath.lastIndexOf('/') + 1);
int startOfSuffix = jarFileName.lastIndexOf('_'); int startOfSuffix = jarFileName.lastIndexOf('_');
if (startOfSuffix > 0) { if (startOfSuffix == -1)
String jarFilePrefix = jarFileName.substring(0, startOfSuffix); throw new IllegalStateException("Unexpected jar file name: " + jarFileName);
log.info("jarFilePrefix = " + jarFilePrefix); String jarFilePrefix = jarFileName.substring(0, startOfSuffix);
return jarFilePrefix; log.info("jarFilePrefix = " + jarFilePrefix);
} return jarFilePrefix;
} }
} catch (Exception e) { } catch (Exception e) {
log.error("Unexpected " + e, e); log.error("Unexpected " + e, e);