Skip to content

Do not crash when requesting sigil from a directory instead of a file#86

Merged
Morriar merged 1 commit intomasterfrom
at-sigil-crash
Jun 8, 2021
Merged

Do not crash when requesting sigil from a directory instead of a file#86
Morriar merged 1 commit intomasterfrom
at-sigil-crash

Conversation

@Morriar
Copy link
Contributor

@Morriar Morriar commented Jun 2, 2021

Requesting the sigil from a path that points to a directory was ending up in a crash:

Sigils.file_strictness("/")
Errno::EISDIR: Is a directory @ io_fread - /
    lib/spoom/sorbet/sigils.rb:59:in `read'
    lib/spoom/sorbet/sigils.rb:59:in `file_strictness'

With this PR we return nil instead.

Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
@Morriar Morriar requested a review from a team June 2, 2021 19:49
@Morriar Morriar merged commit 5147877 into master Jun 8, 2021
@Morriar Morriar deleted the at-sigil-crash branch June 8, 2021 13:34
@shopify-shipit shopify-shipit bot temporarily deployed to production July 28, 2021 15:30 Inactive
@shopify-shipit shopify-shipit bot temporarily deployed to production December 8, 2021 21:43 Inactive
@Morriar Morriar added the bugfix Fix a bug label Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fix a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants