This is an automated email from the ASF dual-hosted git repository.

thw pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/master by this push:
     new ee4d27411b3 [FLINK-28977] NullPointerException in 
HybridSourceSplitEnumerator.close (#20587)
ee4d27411b3 is described below

commit ee4d27411b3bf1cfcc4171aab777eb8bf08f1550
Author: Michael <[email protected]>
AuthorDate: Tue Aug 23 05:28:13 2022 -0700

    [FLINK-28977] NullPointerException in HybridSourceSplitEnumerator.close 
(#20587)
---
 .../connector/base/source/hybrid/HybridSourceSplitEnumerator.java    | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/source/hybrid/HybridSourceSplitEnumerator.java
 
b/flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/source/hybrid/HybridSourceSplitEnumerator.java
index 61baabeb941..c09653ec71b 100644
--- 
a/flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/source/hybrid/HybridSourceSplitEnumerator.java
+++ 
b/flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/source/hybrid/HybridSourceSplitEnumerator.java
@@ -246,7 +246,10 @@ public class HybridSourceSplitEnumerator
 
     @Override
     public void close() throws IOException {
-        currentEnumerator.close();
+        // close may be called before currentEnumerator was initialized
+        if (currentEnumerator != null) {
+            currentEnumerator.close();
+        }
     }
 
     private void switchEnumerator() {

Reply via email to