Explorar o código

fix index error on no topics

Daniel Gruno %!s(int64=5) %!d(string=hai) anos
pai
achega
8d71227262
Modificáronse 2 ficheiros con 2 adicións e 1 borrados
  1. 1 0
      CHANGELOG.md
  2. 1 1
      pypubsub.py

+ 1 - 0
CHANGELOG.md

@@ -2,6 +2,7 @@
 - Changed content type to better reflect that this is a custom stream
 - Switched to internal counter for number of requests served
 - Added max payload size setting
+- Fixed an issue where payloads with no topics would cause an indexing error
 
 # 0.4.5
 - Better handling of errored subscriber connections

+ 1 - 1
pypubsub.py

@@ -236,7 +236,7 @@ class Payload:
         self.private = False
 
         # Private payload?
-        if self.topics[0] == 'private':
+        if self.topics and self.topics[0] == 'private':
             self.private = True
             del self.topics[0]  # Remove the private bit from topics now.