NPE when retrieving JPA Entity process variables via REST API /runtime/tasks

Description

When retrieving a JPA Entity based process variable via the REST API using /runtime/tasks?includeProcessVariables=true, a NPE is thrown when finding the JPA Entity.

Retrieval of JPA Entities works via other REST APIs e.g. /runtime/tasks/{taskId}/variables

Log: https://gist.github.com/phowlett/6320510

Unit Test to demonstrate the issue:
https://github.com/phowlett/activiti-unit-test-rest-jpaentity/blob/master/src/test/java/org/activiti/rest/api/jpa/JpaRestTest.java

Proposed fix to RestResponseFactory.java:
https://gist.github.com/phowlett/6320556

Environment

None

Assignee

Tijs Rademakers

Reporter

Paul Howlett

Labels

None

Components

Fix versions

Affects versions

Priority

Critical
Configure