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

CID 160920: Null pointer dereferences (NULL_RETURNS) #279

Open
jewzaam opened this issue Jan 26, 2017 · 0 comments
Open

CID 160920: Null pointer dereferences (NULL_RETURNS) #279

jewzaam opened this issue Jan 26, 2017 · 0 comments

Comments

@jewzaam
Copy link
Member

jewzaam commented Jan 26, 2017

*** 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(),
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

No branches or pull requests

1 participant