cancel
Showing results for 
Search instead for 
Did you mean: 

NPE on AttributeDescriptorModel.getLocalized()

naved_ali
Discoverer
0 Kudos

While adding smartEdit components I am getting null pointer for 'AttributeDescriptorModel.getLocalized()'. I did try searching any of such model with below groovy but it is not giving me any result. Since this is on environment so I cannot debug it. Below is logs and groovy.

Groovy

def SCRIPT_QUERY = "select {pk} from {attributeDescriptor}"
def attributeDescriptors = flexibleSearchService.search(SCRIPT_QUERY).getResult()
println ("groovy start-----------")
for (attributeDescriptor in attributeDescriptors) {
  if(attributeDescriptor.getLocalized()==null)
  {
       println(attributeDescriptor.getName())
  }
}
println ("groovy end-----------")

Logs

loggerName":"de.hybris.platform.webservicescommons.resolver.AbstractRestHandlerExceptionResolver","message":"java.lang.NullPointerException:

Cannot invoke \"java.lang.Boolean.booleanValue()\" because the return value of \"de.hybris.platform.core.model.type.AttributeDescriptorModel.getLocalized()\" is null

\n\tat de.hybris.platform.cms2.common.predicates.IsCollectionAttributePredicate.test(IsCollectionAttributePredicate.java:21)

\n\tat de.hybris.platform.cms2.common.predicates.IsCollectionAttributePredicate.test(IsCollectionAttributePredicate.java:17)\

n\tat de.hybris.platform.cmsfacades.types.populator.DropdownComponentTypeAttributePopulator.populate(DropdownComponentTypeAttributePopulator.java:38)

\n\tat de.hybris.platform.cmsfacades.types.populator.DropdownComponentTypeAttributePopulator.populate(DropdownComponentTypeAttributePopulator.java:25)

\n\tat de.hybris.platform.cmsfacades.types.converter.ComponentTypeStructureConverter.lambda$convertAttribute$5(ComponentTypeStructureConverter.java:183)

\n\tat java.base/java.util.ArrayList.forEach(ArrayList.java:1511)\n\tat de.hybris.platform.cmsfacades.types.converter.ComponentTypeStructureConverter.convertAttribute(ComponentTypeStructureConverter.java:183)

Accepted Solutions (0)

Answers (0)