Skip to content

Commit

Permalink
meta could be nil
Browse files Browse the repository at this point in the history
When running typelizer in our project, it fails with `meta nil`.
It's described in https://github.com/okuramasafumi/alba?tab=readme-ov-file#metadata so it's a valid usage.
`meta_fields` now returns early with `meta nil` to prevent errors.
  • Loading branch information
okuramasafumi authored and skryukov committed Sep 5, 2024
1 parent ab90684 commit 1cd1e1a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/typelizer/serializer_plugins/alba.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ def meta_fields
return nil unless serializer._meta

name = serializer._meta.first
return nil unless name

[
build_property(name, name)
]
Expand Down

0 comments on commit 1cd1e1a

Please sign in to comment.