meta: fix lookup of invalid schemata
We need to initialize `schema` to `None`, otherwise it will be an access
to an uninitialized variable when looking up invalid schemata:
[...]
File "[...]/osbuild/meta.py", line 583, in get_schema
schema = Schema(schema, name or klass)
UnboundLocalError: local variable 'schema' referenced before assignment
Signed-off-by: David Rheinsberg <david.rheinsberg@gmail.com>
This commit is contained in:
parent
4a40b732ea
commit
38662b22a6
1 changed files with 1 additions and 0 deletions
|
|
@ -564,6 +564,7 @@ class Index:
|
|||
`None` and any validation will fail.
|
||||
"""
|
||||
cached_schema: Optional[Schema] = self._schemata.get((klass, name, version))
|
||||
schema = None
|
||||
|
||||
if cached_schema is not None:
|
||||
return cached_schema
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue