diff --git a/software/source/server/utils/kernel.py b/software/source/server/utils/kernel.py index b443bbaf..e8ac7fb1 100644 --- a/software/source/server/utils/kernel.py +++ b/software/source/server/utils/kernel.py @@ -45,15 +45,16 @@ def custom_filter(message): def check_filtered_kernel(): messages = get_kernel_messages() - messages.replace(last_messages, "") - messages = messages.split("\n") - - filtered_messages = [] - for message in messages: - if custom_filter(message): - filtered_messages.append(message) - - return "\n".join(filtered_messages) + if messages: + messages.replace(last_messages, "") + messages = messages.split("\n") + + filtered_messages = [] + for message in messages: + if custom_filter(message): + filtered_messages.append(message) + + return "\n".join(filtered_messages) async def put_kernel_messages_into_queue(queue): while True: