Merge pull request #4712 from rzats/bugfix-4696

CM: Fix null versions in the contribution manager (#4696)
This commit is contained in:
Ben Fry
2016-10-29 09:52:37 -04:00
committed by GitHub
2 changed files with 16 additions and 4 deletions

View File

@@ -461,7 +461,7 @@ class DetailPanel extends JPanel {
desc.append("</font> ");
String version = contrib.getPrettyVersion();
if (version != null) {
if (version != null && !version.equals("null")) {
desc.append(version);
}
desc.append(" <br/>");

View File

@@ -259,12 +259,24 @@ class StatusPanel extends JPanel {
if (panel.getContrib().isCompatible(Base.getRevision())) {
if (installButton.isEnabled()) {
updateLabel.setText(latestVersion + " available");
if (latestVersion != null) {
updateLabel.setText(latestVersion + " available");
} else {
updateLabel.setText("Available");
}
} else {
updateLabel.setText(currentVersion + " installed");
if (currentVersion != null && !currentVersion.equals("null")) {
updateLabel.setText(currentVersion + " installed");
} else {
updateLabel.setText("Installed");
}
}
} else {
updateLabel.setText(currentVersion + " not compatible");
if (currentVersion != null && !currentVersion.equals("null")) {
updateLabel.setText(currentVersion + " not compatible");
} else {
updateLabel.setText("Not compatible");
}
}
if (latestVersion != null) {