From 08496533e2ee00736c954b228d3d863beedf91ed Mon Sep 17 00:00:00 2001 From: Jake Ob Date: Sun, 16 Apr 2023 20:19:15 +0300 Subject: [PATCH] Process data only if data is given --- jc/parsers/bluetoothctl.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/jc/parsers/bluetoothctl.py b/jc/parsers/bluetoothctl.py index 2f0c753c..9bfe93d4 100644 --- a/jc/parsers/bluetoothctl.py +++ b/jc/parsers/bluetoothctl.py @@ -342,15 +342,15 @@ def parse(data: str, raw: bool = False, quiet: bool = False) -> List[JSONDictTyp List of Dictionaries. Raw or processed structured data. """ - jc.utils.compatibility(__name__, info.compatible, quiet) - jc.utils.input_type_check(data) - - linedata = data.splitlines() - linedata.reverse() - result: List[TypeDict] = [] if jc.utils.has_data(data): + jc.utils.compatibility(__name__, info.compatible, quiet) + jc.utils.input_type_check(data) + + linedata = data.splitlines() + linedata.reverse() + while linedata: element = None if data.startswith("Controller"):