github-code-scanning[bot] commented on code in PR #13046:
URL:
https://github.com/apache/dolphinscheduler/pull/13046#discussion_r1034755412
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/QueueServiceImpl.java:
##########
@@ -224,6 +233,53 @@
return result;
}
+ /**
+ * delete queue
+ *
+ * @param loginUser login user
+ * @param id queue id
+ * @return delete result code
+ * @throws Exception exception
+ */
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public Map<String, Object> deleteQueueById(User loginUser, int id) throws
Exception {
+ Map<String, Object> result = new HashMap<>();
+
+ if (!canOperatorPermissions(loginUser, null, AuthorizationType.TENANT,
TENANT_DELETE)) {
+ throw new ServiceException(Status.USER_NO_OPERATION_PERM);
+ }
+
+ Queue queue = queueMapper.selectById(id);
+ if (Objects.isNull(queue)) {
+ logger.error("Queue does not exist");
+ throw new ServiceException(Status.QUEUE_NOT_EXIST,
queue.getQueue());
Review Comment:
## Dereferenced variable is always null
Variable [queue](1) is always null at this dereference.
[Show more
details](https://github.com/apache/dolphinscheduler/security/code-scanning/2359)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]