aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Schofield <git@ajschof.me>2025-02-21 03:28:37 +0000
committerAlex Schofield <git@ajschof.me>2025-02-21 03:28:37 +0000
commitcf6cac75a85c0c13c798bef61b0f27499986308b (patch)
tree56c08d58692b603a6a01fc8675c7d1124437aa87
parent0d05e4f9ca4ca1d2a60802df02f8037886a797fc (diff)
downloadgdpr-obfuscator-cf6cac75a85c0c13c798bef61b0f27499986308b.tar.gz
gdpr-obfuscator-cf6cac75a85c0c13c798bef61b0f27499986308b.zip
return empty byte string if input data is empty
-rw-r--r--gdpr_obfuscator/utils.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/gdpr_obfuscator/utils.py b/gdpr_obfuscator/utils.py
index c8aadb2..918bf99 100644
--- a/gdpr_obfuscator/utils.py
+++ b/gdpr_obfuscator/utils.py
@@ -17,6 +17,9 @@ class Utilities:
def create_byte_stream(self, data: List[Dict[str, str]]) -> bytes:
+ if not data:
+ return b""
+
output = io.StringIO()
headers = list(data[0].keys())
git.ajschof.me — hosted by ajschofield — powered by cgit