mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-01-12 23:43:22 -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:
parent
1312349ca1
commit
d8b8d5d5e0
@ -290,7 +290,7 @@ impl State {
|
|||||||
let states = self.types_by_uuid.get(&s.type_)
|
let states = self.types_by_uuid.get(&s.type_)
|
||||||
.map(|t| &t.states)
|
.map(|t| &t.states)
|
||||||
.unwrap_or(&empty);
|
.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 {}",
|
bail_t!(FailedPrecondition, "signal {} specifies unknown state {}",
|
||||||
signal, state);
|
signal, state);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user