Hi! I’ve recently upgraded my to WPILIB 2023 (along with the firmware for our roboRio and the navX). However, I’m getting null pointer errors from my code, even though they didn’t show in the 2022 version. This is my code:
And here are my logs. Any help is appreciated. Thank you in advance!
-
Unhandled exception: java.lang.NullPointerException: Cannot read the array length because “” is null
-
Error at frc.robot.subsystems.Swerve.getSwerveModulePositions(Swerve.java:129): Unhandled exception: java.lang.NullPointerException: Cannot read the array length because “” is null
-
at frc.robot.subsystems.Swerve.getSwerveModulePositions(Swerve.java:129)
-
at frc.robot.subsystems.Swerve.(Swerve.java:44)
-
at frc.robot.subsystems.Limelight.(Limelight.java:24)
-
at frc.robot.RobotContainer.(RobotContainer.java:32)
-
at frc.robot.Robot.robotInit(Robot.java:37)
-
at edu.wpi.first.wpilibj.TimedRobot.startCompetition(TimedRobot.java:106)
-
at edu.wpi.first.wpilibj.RobotBase.runRobot(RobotBase.java:343)
-
at edu.wpi.first.wpilibj.RobotBase.startRobot(RobotBase.java:433)
-
at frc.robot.Main.main(Main.java:23)
from: edu.wpi.first.wpilibj.RobotBase.runRobot(RobotBase.java:365)