1
0
mirror of https://github.com/1C-Company/v8-code-style.git synced 2025-04-09 17:34:02 +02:00

NPE исправление если параметр отсутствует

This commit is contained in:
Dmitriy Marmyshev 2022-02-16 18:11:56 +03:00
parent 7eb215cd47
commit d17921b98a

View File

@ -74,6 +74,7 @@ public class ParametersSectionCheck
if (root.getMethod().getFormalParams().isEmpty())
{
// TODO Extract to new check that parameter section is empty and useless
resultAceptor.addIssue(Messages.ParametersSectionCheck_Remove_useless_parameter_section,
parameterSection.getHeaderKeywordLength());
return;
@ -87,7 +88,9 @@ public class ParametersSectionCheck
Set<String> parameterNames = new TreeSet<>(String.CASE_INSENSITIVE_ORDER);
root.getMethod().getFormalParams().forEach(p -> {
if (p != null && StringUtils.isNotBlank(p.getName()))
{
parameterNames.add(p.getName());
}
});
for (FieldDefinition parameterDefinition : parameterSection.getParameterDefinitions())