mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-06 21:45:32 +03:00
Catch error when regex is invalid
This commit is contained in:
parent
fe571dc217
commit
50d27bdfb8
@ -1500,6 +1500,7 @@ class LicensePlateProcessingMixin:
|
|||||||
|
|
||||||
# Determine subLabel based on known plates, use regex matching
|
# Determine subLabel based on known plates, use regex matching
|
||||||
# Default to the detected plate, use label name if there's a match
|
# Default to the detected plate, use label name if there's a match
|
||||||
|
try:
|
||||||
sub_label = next(
|
sub_label = next(
|
||||||
(
|
(
|
||||||
label
|
label
|
||||||
@ -1512,6 +1513,11 @@ class LicensePlateProcessingMixin:
|
|||||||
),
|
),
|
||||||
None,
|
None,
|
||||||
)
|
)
|
||||||
|
except re.error:
|
||||||
|
logger.error(
|
||||||
|
f"{camera}: Invalid regex in known plates configuration: {self.lpr_config.known_plates}"
|
||||||
|
)
|
||||||
|
sub_label = None
|
||||||
|
|
||||||
# If it's a known plate, publish to sub_label
|
# If it's a known plate, publish to sub_label
|
||||||
if sub_label is not None:
|
if sub_label is not None:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user