mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Fix null check order in SendableRegistry (#2314)
This commit is contained in:
committed by
Peter Johnson
parent
3bcf8057d4
commit
068465146b
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user