Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Prevent usage of Oj once requiring it already raised an exception #383

Merged
merged 1 commit into from
Apr 30, 2024

Conversation

Ferenc-
Copy link
Contributor

@Ferenc- Ferenc- commented Apr 29, 2024

Fixes the following exception, which happens,
when the require statement has raised an exception, but only after the 'Oj' name is already defined.

E, [2024-04-29T13:33:24.549280 #108] ERROR -- : undefined method `dump' for Oj:Module

        defined?(Oj) ? Oj.dump(data, mode: :strict) : JSON.dump(data)
                         ^^^^^
Did you mean?  dup

Fixes the following exception, which happens,
when the require statement has raised an exception,
but only after the 'Oj' name is already defined.

````
E, [2024-04-29T13:33:24.549280 #108] ERROR -- : undefined method `dump' for Oj:Module

        defined?(Oj) ? Oj.dump(data, mode: :strict) : JSON.dump(data)
                         ^^^^^
Did you mean?  dup
```

Signed-off-by: Ferenc Géczi <[email protected]>
Copy link
Member

@pvital pvital left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me.

@Ferenc- Ferenc- merged commit c2cd37f into master Apr 30, 2024
170 checks passed
@Ferenc- Ferenc- deleted the fix-undefined-method-up branch April 30, 2024 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants