diff options
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2017-02-16 11:27:36 +0000 |
---|---|---|
committer | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2017-02-16 11:27:36 +0000 |
commit | c372bd516862781f372fef352508d429620c418c (patch) | |
tree | bfc6cdfdcf46ea7b54d52d52d0a500289015622f | |
parent | cabf6231316ba97aab0957eac92a32716277ebfc (diff) | |
download | slixmpp-c372bd516862781f372fef352508d429620c418c.tar.gz slixmpp-c372bd516862781f372fef352508d429620c418c.tar.bz2 slixmpp-c372bd516862781f372fef352508d429620c418c.tar.xz slixmpp-c372bd516862781f372fef352508d429620c418c.zip |
xmlstream: Warn when the parser is None when data is received.
-rw-r--r-- | slixmpp/xmlstream/xmlstream.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/slixmpp/xmlstream/xmlstream.py b/slixmpp/xmlstream/xmlstream.py index 0b5a55e1..8daf99e4 100644 --- a/slixmpp/xmlstream/xmlstream.py +++ b/slixmpp/xmlstream/xmlstream.py @@ -358,6 +358,10 @@ class XMLStream(asyncio.BaseProtocol): event. This could trigger one or more event (a stanza is received, the stream is opened, etc). """ + if self.parser is None: + log.warning('Received data before the connection is established: %r', + data) + return self.parser.feed(data) try: for event, xml in self.parser.read_events(): |