mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-102: Move null check for connection weight to the connection model.
This commit is contained in:
committed by
Nick Couchman
parent
4033e097c7
commit
58637818ca
@@ -191,6 +191,8 @@ public class ConnectionModel extends ChildObjectModel {
|
||||
* -1 indicates that the system is unavailable.
|
||||
*/
|
||||
public Integer getConnectionWeight() {
|
||||
if (connectionWeight == null)
|
||||
return 1;
|
||||
return connectionWeight;
|
||||
}
|
||||
|
||||
|
@@ -190,14 +190,14 @@ public class RestrictedGuacamoleTunnelService
|
||||
|
||||
int weightA, weightB;
|
||||
// Check if weight of a is non-null and retrieve it.
|
||||
if (a.getConnectionWeight() != null && a.getConnectionWeight().intValue() > 0)
|
||||
if (a.getConnectionWeight().intValue() > 0)
|
||||
weightA = a.getConnectionWeight().intValue();
|
||||
// In all other cases assign 1 for sorting.
|
||||
else
|
||||
weightA = 1;
|
||||
|
||||
// Check if weight of b is null, assign 1 if it is.
|
||||
if (b.getConnectionWeight() != null && b.getConnectionWeight().intValue() > 0)
|
||||
if (b.getConnectionWeight().intValue() > 0)
|
||||
weightB = b.getConnectionWeight().intValue();
|
||||
// In all other cases assign 1 for sorting.
|
||||
else
|
||||
|
Reference in New Issue
Block a user