ToughTechs151 / ChargedUp2023

Other
1 stars 0 forks source link

Handle file not found conditions in Splash.java #22

Open blu28 opened 1 year ago

blu28 commented 1 year ago

If the getResourceAsStream method cannot find a file, it returns a null. On the other hand, the BufferedInputStream throws a FileNotFound exception. The null return ends up throwing a NullPointer exception when we go to read the file, which is a RunTimeExcpetion and is passed up the stack, causing the robot code to crash, which is sub-optimal. Make sure both conditions are handled gracefully.