1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-02 19:32:19 +01:00

Fix crash when handling pin_check error (#5915)

This commit is contained in:
Clyde Stubbs
2023-12-13 10:38:37 +11:00
committed by GitHub
parent 03baaa94a8
commit 29002c8f45

View File

@@ -111,7 +111,12 @@ class Config(OrderedDict, fv.FinalValidateConfig):
last_root = max( last_root = max(
i for i, v in enumerate(error.path) if v is cv.ROOT_CONFIG_PATH i for i, v in enumerate(error.path) if v is cv.ROOT_CONFIG_PATH
) )
error.path = error.path[last_root + 1 :] # can't change the path so re-create the error
error = vol.Invalid(
message=error.error_message,
path=error.path[last_root + 1 :],
error_type=error.error_type,
)
self.errors.append(error) self.errors.append(error)
def add_validation_step(self, step: "ConfigValidationStep"): def add_validation_step(self, step: "ConfigValidationStep"):