mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-11-20 09:56:07 -05:00
fix dumb typo bug in signal/state input validation
The effect was that it'd allow any state for signal 0, when it should have allowed state 0 for any signal.
This commit is contained in:
@@ -290,7 +290,7 @@ impl State {
|
||||
let states = self.types_by_uuid.get(&s.type_)
|
||||
.map(|t| &t.states)
|
||||
.unwrap_or(&empty);
|
||||
if signal != 0 && states.binary_search_by_key(&state, |s| s.value).is_err() {
|
||||
if state != 0 && states.binary_search_by_key(&state, |s| s.value).is_err() {
|
||||
bail_t!(FailedPrecondition, "signal {} specifies unknown state {}",
|
||||
signal, state);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user