mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-20 00:51:41 +00:00
Disallow setting NT pipeline index below 0 (#145)
This commit is contained in:
@@ -71,6 +71,12 @@ public class NTDataPublisher implements CVPipelineResultConsumer {
|
||||
var newIndex = (int) entryNotification.value.getDouble();
|
||||
var originalIndex = pipelineIndexSupplier.get();
|
||||
|
||||
// ignore indexes below 0
|
||||
if (newIndex < 0) {
|
||||
pipelineIndexEntry.forceSetNumber(originalIndex);
|
||||
return;
|
||||
}
|
||||
|
||||
if (newIndex == originalIndex) {
|
||||
// TODO: Log
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user