Skip to content

Commit 8763170

Browse files
committed
Fix NPE #33
1 parent 8aa9fa2 commit 8763170

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/org/netbeans/modules/php/wordpress/update/WordPressCoreUpgradeChecker.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ public boolean hasUpgrade(PhpModule phpModule) {
9797
}
9898

9999
WordPressVersion version = WordPressVersion.create(phpModule);
100+
if (version == null) {
101+
return false;
102+
}
100103
return hasUpgrade(version);
101104
} catch (MalformedURLException ex) {
102105
LOGGER.log(Level.WARNING, ex.getLocalizedMessage());
@@ -115,6 +118,9 @@ public boolean hasUpgrade(PhpModule phpModule) {
115118
* @throws NumberFormatException
116119
*/
117120
private boolean hasUpgrade(WordPressVersion version) throws NumberFormatException {
121+
if (version == null) {
122+
return false;
123+
}
118124
// compare version
119125
String[] splitVersion = upgradeVersionNumber.split("[.]"); // NOI18N
120126
int length = splitVersion.length;

0 commit comments

Comments
 (0)