-
Notifications
You must be signed in to change notification settings - Fork 105
1206: Covered possible NullPointerException in InjectAViewModelDialog.java #1213
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
1206: Covered possible NullPointerException in InjectAViewModelDialog.java #1213
Conversation
…ull we will return and avoid execution of the code that could through a NPE. If the code is fine then it will continue as normal.
Let me know if there is anything else I might have missed, Thank you again for your help! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, @Mgonzalez-droid!
Please, take a look at my suggestion.
Regards,
src/com/magento/idea/magento2plugin/actions/generation/dialog/InjectAViewModelDialog.java
Outdated
Show resolved
Hide resolved
…InjectAViewModelDialog.java Co-authored-by: bohdan-harniuk <31848341+bohdan-harniuk@users.noreply.github.com>
Hello, @Mgonzalez-droid! |
I went ahead and made the change you suggested, made a mistake by assuming git would correctly format the code how you suggested. Do apologize, this latest commit should be what you were looking for. If not let me know and I will address it right away. Thank you! |
@Mgonzalez-droid, there is no need to keep else clause. Take a look at line 140: if (!validateFormFields()) {
exit();
return;
} There is no else. Adding else here makes it more nested without any particular reason. |
Hello, @Mgonzalez-droid! |
Description (*)
I added conditional logic to test if the given variable is null, if null we will return and avoid execution of the code that could through a NPE. If the code is fine then it will continue as normal.
Fixed Issues (if relevant)
Contribution checklist (*)