Explorar el Código

avoid NPE if no query string

tags/v0.4.1
Jonathan Cobb hace 4 años
padre
commit
f13b2c9423
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. +1
    -1
      bubble-server/src/main/java/bubble/resources/account/DevicesResource.java

+ 1
- 1
bubble-server/src/main/java/bubble/resources/account/DevicesResource.java Ver fichero

@@ -33,7 +33,7 @@ public class DevicesResource extends AccountOwnedResource<Device, DeviceDAO> {

@Override protected List<Device> list(ContainerRequest ctx) {
final Account caller = userPrincipal(ctx);
if (caller.admin() && ctx.getRequestUri().getQuery().contains("all")) {
if (caller.admin() && ctx.getRequestUri().getQuery() != null && ctx.getRequestUri().getQuery().contains("all")) {
return getDao().findAll().stream().filter(Device::initialized).collect(Collectors.toList());
} else {
return super.list(ctx).stream().filter(Device::initialized).collect(Collectors.toList());


Cargando…
Cancelar
Guardar