diff --git a/kafka_consumer/datadog_checks/kafka_consumer/kafka_consumer.py b/kafka_consumer/datadog_checks/kafka_consumer/kafka_consumer.py
index <HASH>..<HASH> 100644
--- a/kafka_consumer/datadog_checks/kafka_consumer/kafka_consumer.py
+++ b/kafka_consumer/datadog_checks/kafka_consumer/kafka_consumer.py
@@ -283,7 +283,7 @@ class KafkaCheck(AgentCheck):
             consumer_group_tags.extend(self._custom_tags)
 
             partitions = self.kafka_client._client.cluster.partitions_for_topic(topic)
-            if partition in partitions:
+            if partitions is not None and partition in partitions:
                 # report consumer offset if the partition is valid because even if leaderless the consumer offset will
                 # be valid once the leader failover completes
                 self.gauge('consumer_offset', consumer_offset, tags=consumer_group_tags)
Fix missing None check (#<I>)