mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-20 00:51:41 +00:00
Correctly stringify numbers in textboxes (#921)
* fix an issue where the fov isnt reset on error * Fix issue with incorrectly reading fov on update * Properly handle NPE in case of error * Fix issue with vuetify comps not converting strings to numbers * Formatting fixes
This commit is contained in:
@@ -323,7 +323,7 @@ public class RequestHandler {
|
||||
var data = kObjectMapper.readTree(ctx.body());
|
||||
|
||||
int index = data.get("index").asInt();
|
||||
double fov = kObjectMapper.readTree(data.get("settings").asText()).get("fov").asDouble();
|
||||
double fov = data.get("settings").get("fov").asDouble();
|
||||
|
||||
var module = VisionModuleManager.getInstance().getModule(index);
|
||||
module.setFov(fov);
|
||||
@@ -333,7 +333,7 @@ public class RequestHandler {
|
||||
ctx.status(200);
|
||||
ctx.result("Successfully saved camera settings");
|
||||
logger.info("Successfully saved camera settings");
|
||||
} catch (JsonProcessingException e) {
|
||||
} catch (JsonProcessingException | NullPointerException e) {
|
||||
ctx.status(400);
|
||||
ctx.result("The provided camera settings were malformed");
|
||||
logger.error("The provided camera settings were malformed", e);
|
||||
|
||||
Reference in New Issue
Block a user