Skip to content

CID 160920: Null pointer dereferences (NULL_RETURNS) #279

@jewzaam

Description

@jewzaam

*** CID 160920: Null pointer dereferences (NULL_RETURNS)
/lightblue-rest/crud/src/main/java/com/redhat/lightblue/rest/crud/AbstractCrudResource.java: 108 in com.redhat.lightblue.rest.crud.AbstractCrudResource.getSearchesForEntity(java.lang.String, java.lang.String, java.lang.String)()

102             FindRequest freq=new FindRequest();
103             freq.setEntityVersion(new EntityVersion(RestConfiguration.getSavedSearchCache().savedSearchEntity,
104                                                     RestConfiguration.getSavedSearchCache().savedSearchVersion));
105
106             try {
107                 freq.setProjection(projection==null?FieldProjection.ALL:Projection.fromJson(JsonUtils.json(QueryTemplateUtils.buildProjectionsTemplate(projection))));
>>>     CID 160920:  Null pointer dereferences  (NULL_RETURNS)
>>>     Dereferencing a pointer that might be null "com.redhat.lightblue.rest.util.QueryTemplateUtils.buildSortsTemplate(sort)" when calling "json".
108                 freq.setSort(sort==null?new SortKey(new com.redhat.lightblue.util.Path("name"),false):Sort.fromJson(JsonUtils.json(QueryTemplateUtils.buildSortsTemplate(sort))));
109             } catch (Exception e) {
110                 return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(e.toString()).build();
111             }
112             CallStatus st=new FindCommand(freq.getEntityVersion().getEntity(),
113                                           freq.getEntityVersion().getVersion(),

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions