Skip to content

Commit

Permalink
Update MABHandler.java
Browse files Browse the repository at this point in the history
Make it return a selected arm correctly
  • Loading branch information
j50ju authored Oct 21, 2024
1 parent e73395d commit 9e2a5d3
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,14 @@ public class MABHandler {
public static String getArm(String dataSource, IScope2 scope) {
List<Arm> arms = getarms(dataSource, scope);
Arm selectedArm = selectArm(arms);
Log.d(TAG, "getArm: list = " + arms);
Log.d(TAG, "getArm: selected = " + selectedArm);
return "";
// Ensure that selected arm is not null
if (selectedArm != null) {
Log.d(TAG, "getArm: selected = " + selectedArm.name);
return selectedArm.name;
} else {
Log.e(TAG, "getArm: No arm was selected");
return "default_arm";
}
}

// Selects an arm from a list of arms
Expand Down

0 comments on commit 9e2a5d3

Please sign in to comment.