Skip to content

Commit

Permalink
Merge pull request #2521 from sa2ajj/more-coverity-fixes
Browse files Browse the repository at this point in the history
fix CID 1382001: Attribute/item access or function call before check for None or undefined
  • Loading branch information
tardyp committed Dec 9, 2016
2 parents 0683989 + 06ac5f8 commit a677012
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions master/buildbot/www/ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def cmd_startConsuming(self, path, _id):
return

# if it's already subscribed, don't leak a subscription
if path in self.qrefs:
if self.qrefs is not None and path in self.qrefs:
yield self.ack(_id=_id)
return

Expand All @@ -93,8 +93,10 @@ def callback(key, message):
if self.qrefs is None or path in self.qrefs:
qref.stopConsuming()

self.qrefs[path] = qref
self.ack(_id=_id)
# only store and ack if we were not disconnected in between
if self.qrefs is not None:
self.qrefs[path] = qref
self.ack(_id=_id)

@defer.inlineCallbacks
def cmd_stopConsuming(self, path, _id):
Expand Down

0 comments on commit a677012

Please sign in to comment.