This is an automated email from the ASF dual-hosted git repository.
zhaoqingran pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hertzbeat.git
The following commit(s) were added to refs/heads/master by this push:
new 16cec10fa [improve] preventing NPE (#1808)
16cec10fa is described below
commit 16cec10fa33c7efa1fa9bdf0ed42cd8bbdcf40be
Author: Hyeon Sung <[email protected]>
AuthorDate: Mon Apr 22 11:32:44 2024 +0900
[improve] preventing NPE (#1808)
---
.../org/apache/hertzbeat/collector/collect/pop3/Pop3CollectImpl.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git
a/collector/src/main/java/org/apache/hertzbeat/collector/collect/pop3/Pop3CollectImpl.java
b/collector/src/main/java/org/apache/hertzbeat/collector/collect/pop3/Pop3CollectImpl.java
index 8e41c0850..1feb155ea 100644
---
a/collector/src/main/java/org/apache/hertzbeat/collector/collect/pop3/Pop3CollectImpl.java
+++
b/collector/src/main/java/org/apache/hertzbeat/collector/collect/pop3/Pop3CollectImpl.java
@@ -112,8 +112,8 @@ public class Pop3CollectImpl extends AbstractCollect {
* @throws Exception exception
*/
private void validateParams(Metrics metrics) throws Exception {
- Pop3Protocol pop3Protocol = metrics.getPop3();
- if (metrics == null || pop3Protocol == null ||
pop3Protocol.isInvalid()) {
+ Pop3Protocol pop3Protocol;
+ if (metrics == null || (pop3Protocol = metrics.getPop3()) == null ||
pop3Protocol.isInvalid()) {
throw new Exception("Pop3 collect must has pop3 params");
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]