showuon commented on code in PR #13512: URL: https://github.com/apache/kafka/pull/13512#discussion_r1159574976
########## streams/src/main/java/org/apache/kafka/streams/processor/internals/StoreChangelogReader.java: ########## @@ -690,7 +691,7 @@ private int restoreChangelog(final Task task, final ChangelogMetadata changelogM } } - if (numRecords > 0 || changelogMetadata.state().equals(ChangelogState.COMPLETED)) { + if (task != null && (numRecords > 0 || changelogMetadata.state().equals(ChangelogState.COMPLETED))) { Review Comment: In https://github.com/apache/kafka/pull/13300/files#r1123945673 , we discussed if the null check is necessary, and then decided to drop it. But it turns out it's necessary. Otherwise, NPE will be thrown in some test cases. -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org