diff options
| author | Alex Schofield <git@ajschof.me> | 2025-02-21 03:28:37 +0000 |
|---|---|---|
| committer | Alex Schofield <git@ajschof.me> | 2025-02-21 03:28:37 +0000 |
| commit | cf6cac75a85c0c13c798bef61b0f27499986308b (patch) | |
| tree | 56c08d58692b603a6a01fc8675c7d1124437aa87 /gdpr_obfuscator/utils.py | |
| parent | 0d05e4f9ca4ca1d2a60802df02f8037886a797fc (diff) | |
| download | gdpr-obfuscator-cf6cac75a85c0c13c798bef61b0f27499986308b.tar.gz gdpr-obfuscator-cf6cac75a85c0c13c798bef61b0f27499986308b.zip | |
return empty byte string if input data is empty
Diffstat (limited to 'gdpr_obfuscator/utils.py')
| -rw-r--r-- | gdpr_obfuscator/utils.py | 3 |
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()) |
