Skip to content

Commit 02eb4d8

Browse files
fallback port to serialDevice properly
1 parent 227b824 commit 02eb4d8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/main/java/ru/r2cloud/util/Configuration.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -587,9 +587,13 @@ private DeviceConfiguration getDeviceConfiguration(String id, DeviceType deviceT
587587
config.setMaximumFrequency(maxFrequency);
588588
}
589589
config.setHost(getProperty(prefix + "host"));
590-
Integer port = getInteger(prefix + "port");
591-
if (port != null) {
592-
config.setPort(port);
590+
String portStr = getProperty(prefix + "port");
591+
if (portStr != null) {
592+
try {
593+
config.setPort(Integer.parseInt(portStr));
594+
} catch (Exception e) {
595+
// ignore. legacy serialDevice setting
596+
}
593597
}
594598
config.setUsername(getProperty(prefix + "username"));
595599
config.setPassword(getProperty(prefix + "password"));

0 commit comments

Comments
 (0)