Changelog table crashes if it tries to render a commit with an empty message

Brett Smith brett at sfconservancy.org
Mon Dec 14 21:04:59 UTC 2020


Hi,

I recently upgraded a Kallithea server to 0.6.3, and I was running into 
an issue where trying to view the landing page for one specific 
repository, but not others, was crashing.

I tracked this down to the changelog_table.html template. It runs 
message_lines = cs.message.splitlines() and tries to show the first line 
of the message by rendering message_lines[0]. However, if the commit 
message is completely empty, message_lines will be too, so trying to 
access message_lines[0] raises an uncaught IndexError.

Attached is a patch that does the bare minimum to avoid the crash, by 
forcing message_lines to contain an empty string in this case. It might 
be nice to do something nicer like render a dedicated, localized message 
in this case. But hopefully this helps identify the issue.

Hope this helps. If you need any additional information, please let me know.

Thanks,

-- 
Brett Smith
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sfconservancy.org/pipermail/kallithea-general/attachments/20201214/27351656/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: changelog_table.patch
Type: text/x-patch
Size: 678 bytes
Desc: not available
URL: <http://lists.sfconservancy.org/pipermail/kallithea-general/attachments/20201214/27351656/attachment.bin>


More information about the kallithea-general mailing list