Skip to content

Commit

Permalink
Issue #25: Safety: Do not fail, if no Maven builder is used.
Browse files Browse the repository at this point in the history
  • Loading branch information
haumacher committed Dec 13, 2024
1 parent 65bab91 commit ed70f60
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions mjsip-sip/src/main/java/org/mjsip/sip/provider/SipStack.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,14 @@ public class SipStack {
String v;
try (InputStream in = SipStack.class
.getResourceAsStream("/META-INF/maven/org.mjsip/mjsip-sip/pom.properties")) {
Properties properties = new Properties();
properties.load(in);
v = properties.getProperty("version");
if (in == null) {
// This may happen, if no Maven builder is used in a development environment
v = "development";
} else {
Properties properties = new Properties();
properties.load(in);
v = properties.getProperty("version");
}
} catch (IOException ex) {
v = "unknown";
}
Expand Down

0 comments on commit ed70f60

Please sign in to comment.