Skip to content

Commit 6be6b8d

Browse files
committed
PL-51773 Add guard around debug log
**What** - Adds a None check on the feature config type before we attempt to log it **Why** - If the featureConfig is None then we'll get an error
1 parent 8295c22 commit 6be6b8d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

featureflags/streaming.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,14 @@ def run(self):
166166
identifier=self._msg.identifier,
167167
environment_uuid=self._environemnt_id,
168168
cluster=self._cluster).parsed
169-
log.debug("Feature config '%s' loaded", fc.feature)
170-
self._repository.set_flag(fc)
171-
log.debug('flag %s successfully stored in the cache',
172-
fc.feature)
169+
170+
if fc is None:
171+
log.debug("Feature config '%s' not loaded", self._msg.identifier)
172+
else:
173+
log.debug("Feature config '%s' loaded", fc.feature)
174+
self._repository.set_flag(fc)
175+
log.debug('flag %s successfully stored in the cache',
176+
fc.feature)
173177

174178
except UnrecoverableRequestException as e:
175179
warning_fetch_feature_by_id_failed(e)

0 commit comments

Comments
 (0)