Skip to content

Commit 53242e9

Browse files
authored
Merge pull request #490 from SpectraLogic/get_system_info_fix
Fix for https://jira.spectralogic.com/browse/JSDK-245 Null Pointer exception for get system info.
2 parents 6cb530b + 896ea8c commit 53242e9

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
allprojects {
1717
group = 'com.spectralogic.ds3'
18-
version = '3.5.0'
18+
version = '3.5.1'
1919
}
2020

2121
subprojects {

ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/PropertyUtils.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
package com.spectralogic.ds3client.utils;
1717

18-
import java.io.IOException;
1918
import java.io.InputStream;
2019
import java.util.Properties;
2120
import java.util.concurrent.atomic.AtomicReference;
@@ -47,13 +46,18 @@ public static String getSdkVersion() {
4746
try (final InputStream propertiesStream = PropertyUtils.class.getClassLoader().getResourceAsStream(PROPERTIES_FILE_NAME)) {
4847
if (propertiesStream != null) {
4948
properties.load(propertiesStream);
50-
final String versionFromPropFile = properties.get(SDK_VERSION_PROPERTY_NAME).toString();
51-
if (!Guard.isStringNullOrEmpty(versionFromPropFile)) {
52-
versionProperty.set(versionFromPropFile);
49+
final Object versionPropertyObject = properties.get(SDK_VERSION_PROPERTY_NAME);
50+
51+
if (versionPropertyObject != null) {
52+
final String versionFromPropFile = properties.get(SDK_VERSION_PROPERTY_NAME).toString();
53+
54+
if ( ! Guard.isStringNullOrEmpty(versionFromPropFile)) {
55+
versionProperty.set(versionFromPropFile);
56+
}
5357
}
5458
}
55-
} catch (final IOException e) {
56-
LOG.warn("Could not read properties file.", e);
59+
} catch (final Throwable t) {
60+
LOG.warn("Could not read properties file.", t);
5761
}
5862

5963
return versionProperty.get();

0 commit comments

Comments
 (0)