Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Handle NumberFormatExceptions.

  • Loading branch information...
commit 93c05aa906704e0b6f9f09968824e1da602f1ae1 1 parent 920f6d4
Patrick Atoon Raptor399 authored
Showing with 10 additions and 2 deletions.
  1. +10 −2 src/main/java/net/pms/encoders/MEncoderVideo.java
12 src/main/java/net/pms/encoders/MEncoderVideo.java
View
@@ -1006,7 +1006,11 @@ public String executable() {
int bitrates[] = new int[2];
if (bitrate.contains("(") && bitrate.contains(")")) {
- bitrates[1] = Integer.parseInt(bitrate.substring(bitrate.indexOf("(") + 1, bitrate.indexOf(")")));
+ try {
+ bitrates[1] = Integer.parseInt(bitrate.substring(bitrate.indexOf("(") + 1, bitrate.indexOf(")")));
+ } catch (NumberFormatException e) {
+ bitrates[1] = 0;
+ }
}
if (bitrate.contains("(")) {
@@ -1017,7 +1021,11 @@ public String executable() {
bitrate = "0";
}
- bitrates[0] = (int) Double.parseDouble(bitrate);
+ try {
+ bitrates[0] = (int) Double.parseDouble(bitrate);
+ } catch (NumberFormatException e) {
+ bitrates[0] = 0;
+ }
return bitrates;
}
Please sign in to comment.
Something went wrong with that request. Please try again.