mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Fix for #277 - please check fetchPaths not null - NPE on OrmQueryDetail.convertManyFetchJoinsToQueryJoins(OrmQueryDetail.java:331)
This commit is contained in:
@@ -328,7 +328,7 @@ public class OrmQueryDetail implements Serializable {
|
||||
|
||||
for (String fetchPath : fetchPaths.keySet()) {
|
||||
ElPropertyDeploy elProp = beanDescriptor.getElPropertyDeploy(fetchPath);
|
||||
if (elProp.containsManySince(manyFetchProperty)) {
|
||||
if (elProp != null && elProp.containsManySince(manyFetchProperty)) {
|
||||
|
||||
// this is a join to a *ToMany
|
||||
OrmQueryProperties chunk = fetchPaths.get(fetchPath);
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.avaje.tests.query;
|
||||
|
||||
import com.avaje.ebean.BaseTestCase;
|
||||
import com.avaje.ebean.Ebean;
|
||||
import com.avaje.tests.model.basic.Customer;
|
||||
import org.junit.Test;
|
||||
|
||||
public class TestInvalidFetchPath extends BaseTestCase {
|
||||
|
||||
@Test
|
||||
public void testWithPathAndProperties() {
|
||||
|
||||
Ebean.find(Customer.class)
|
||||
.fetch("notHaveProps", "notHaveProps")
|
||||
.findList();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user