[Functions] Check executor null when closing the FileSource
@@ -57,6 +57,7 @@ public class FileSource extends PushSource<byte[]> {
@Override
public void close() throws Exception {
+ if (executor != null) {
executor.shutdown();
try {
if (!executor.awaitTermination(800, TimeUnit.MILLISECONDS)) {
@@ -67,3 +68,4 @@ public class FileSource extends PushSource<byte[]> {
}
}
}
+}
