mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
[wpilib] Throw on nonexistent SimDevice name in SimDeviceSim constructor (#5041)
Previously this would just create a object that was otherwise non-functional.
This commit is contained in:
@@ -25,6 +25,9 @@ public class SimDeviceSim {
|
||||
*/
|
||||
public SimDeviceSim(String name) {
|
||||
this(SimDeviceDataJNI.getSimDeviceHandle(name));
|
||||
if (m_handle == 0) {
|
||||
throw new IllegalArgumentException("No sim device exists with name '" + name + "'.");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user