From f9b73c71257480df04ab5bd7f83cedeab22cb6d6 Mon Sep 17 00:00:00 2001 From: Alextopher Date: Wed, 11 Sep 2024 12:29:21 -0400 Subject: [PATCH] fix: reflection bug in `onDataChangeEvent` --- .../vision/processes/VisionModuleChangeSubscriber.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/photon-core/src/main/java/org/photonvision/vision/processes/VisionModuleChangeSubscriber.java b/photon-core/src/main/java/org/photonvision/vision/processes/VisionModuleChangeSubscriber.java index 2e0310569e..73a8774906 100644 --- a/photon-core/src/main/java/org/photonvision/vision/processes/VisionModuleChangeSubscriber.java +++ b/photon-core/src/main/java/org/photonvision/vision/processes/VisionModuleChangeSubscriber.java @@ -227,7 +227,7 @@ public void onDataChangeEvent(DataChangeEvent event) { propField.setBoolean(currentSettings, (Boolean) newPropValue); } } else { - propField.set(newPropValue, newPropValue); + propField.set(currentSettings, newPropValue); } logger.trace("Set prop " + propName + " to value " + newPropValue); } catch (NoSuchFieldException | IllegalAccessException e) { @@ -237,8 +237,9 @@ public void onDataChangeEvent(DataChangeEvent event) { + " with value " + newPropValue + " on " - + currentSettings, - e); + + currentSettings + + " | " + + e.getClass().getSimpleName()); } catch (Exception e) { logger.error("Unknown exception when setting PSC prop!", e); }