소스 검색

fix index error on no topics

Daniel Gruno 5 년 전
부모
커밋
8d71227262
2개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  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.