mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-11 01:54:25 +01:00
pylightning: Handle empty log lines correctly
Logging an empty line (without newline character) would raise an Exception due to out of bounds check. Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
committed by
Rusty Russell
parent
5d05694920
commit
1c8b980985
@@ -343,7 +343,7 @@ class PluginStream(object):
|
||||
def write(self, payload):
|
||||
self.buff += payload
|
||||
|
||||
if payload[-1] == '\n':
|
||||
if len(payload) > 0 and payload[-1] == '\n':
|
||||
self.flush()
|
||||
|
||||
def flush(self):
|
||||
|
||||
Reference in New Issue
Block a user