Showing
1 changed file
with
4 additions
and
1 deletions
... | ... | @@ -575,7 +575,10 @@ public class ThingsModelServiceImpl |
575 | 575 | .eq(isCategory, TkThingsModelEntity::getCategoryId, entity.getCategoryId()) |
576 | 576 | .eq(!isCategory, TkThingsModelEntity::getDeviceProfileId, entity.getDeviceProfileId())); |
577 | 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 | 583 | return sortEntity; |
581 | 584 | } | ... | ... |