Showing
1 changed file
with
4 additions
and
1 deletions
@@ -575,7 +575,10 @@ public class ThingsModelServiceImpl | @@ -575,7 +575,10 @@ public class ThingsModelServiceImpl | ||
575 | .eq(isCategory, TkThingsModelEntity::getCategoryId, entity.getCategoryId()) | 575 | .eq(isCategory, TkThingsModelEntity::getCategoryId, entity.getCategoryId()) |
576 | .eq(!isCategory, TkThingsModelEntity::getDeviceProfileId, entity.getDeviceProfileId())); | 576 | .eq(!isCategory, TkThingsModelEntity::getDeviceProfileId, entity.getDeviceProfileId())); |
577 | if(sortEntity==null){ | 577 | if(sortEntity==null){ |
578 | - sortEntity=getSortEntityList(entity,isCategory).stream().filter(s->{return s.getSort().intValue()==sort.intValue();}).findFirst().get(); | 578 | + Optional<TkThingsModelEntity> optional=getSortEntityList(entity,isCategory).stream().filter(s->{return s.getSort().intValue()==sort.intValue();}).findFirst(); |
579 | + if(optional.isPresent()) { | ||
580 | + sortEntity = optional.get(); | ||
581 | + } | ||
579 | } | 582 | } |
580 | return sortEntity; | 583 | return sortEntity; |
581 | } | 584 | } |