diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SendableRegistry.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SendableRegistry.java index a8cd5572f0..99b72a0006 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SendableRegistry.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SendableRegistry.java @@ -1,5 +1,5 @@ /*----------------------------------------------------------------------------*/ -/* Copyright (c) 2019 FIRST. All Rights Reserved. */ +/* Copyright (c) 2019-2020 FIRST. All Rights Reserved. */ /* Open Source Software - may be modified and shared by FRC teams. The code */ /* must be accompanied by the FIRST BSD license file in the root directory of */ /* the project. */ @@ -338,10 +338,10 @@ public class SendableRegistry { return null; } Object rv = null; - if (handle < comp.m_data.length) { - rv = comp.m_data[handle]; - } else if (comp.m_data == null) { + if (comp.m_data == null) { comp.m_data = new Object[handle + 1]; + } else if (handle < comp.m_data.length) { + rv = comp.m_data[handle]; } else { comp.m_data = Arrays.copyOf(comp.m_data, handle + 1); }