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

catch exception to prevent plugin crash #47

Merged
merged 2 commits into from
Aug 10, 2023
Merged

Conversation

marcosh
Copy link
Contributor

@marcosh marcosh commented Aug 9, 2023

As I mentioned in #34, this little change should prevent the plugin to crash in some cases

@mcaskill mcaskill merged commit 8392327 into psalm:master Aug 10, 2023
3 checks passed
anomiex added a commit to anomiex/psalm-plugin-wordpress that referenced this pull request Feb 29, 2024
In psalm#47 a try-catch was added to handle one case where
`->getStatementsSource()->getNodeTypeProvider()` is being called and is
throwing an exception because Psalm's FileAnalyzer doesn't populate the
node type provider until after its NamespaceAnalyzer has already tried
to analyze the whole file (see also psalm#34).

There are three other code paths making a similar call, at least one of
which runs into the same problem. Let's add try-catches to all of them.
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.

2 participants