update resource may NPE (#1610)

* misspell  words

* modify common queue TaskQueueZKImplTest.java unit test

* extends  BaseTaskQueueTest get zkServer

* modify zk config

* update resource may NPE
This commit is contained in:
samz406 2019-12-27 17:20:34 +08:00 committed by bao liang
parent 7f27c8a86e
commit be5fc116ef

View File

@ -210,7 +210,6 @@ public class ResourcesService extends BaseService {
}
Resource resource = resourcesMapper.selectById(resourceId);
String originResourceName = resource.getAlias();
if (resource == null) {
putMsg(result, Status.RESOURCE_NOT_EXIST);
return result;
@ -236,6 +235,7 @@ public class ResourcesService extends BaseService {
}
//get the file suffix
String originResourceName = resource.getAlias();
String suffix = originResourceName.substring(originResourceName.lastIndexOf("."));
//if the name without suffix then add it ,else use the origin name