git2json icon indicating copy to clipboard operation
git2json copied to clipboard

Fixed an exception that occurs when parse_message_line receives empty string

Open nitzanfarhi opened this issue 2 years ago • 1 comments

Hi 😄 , an exception occured to me when parse_message_line receives an empty string. When this occurs, parse_message_line returns None. After that, "\n".join throws an exception when one of the members of the list is none.

Example to an input that causes this is:

parts['message']='    Adding titles to links\n    \u2028\n'

The fix is simple, replace None with empty string.

nitzanfarhi avatar Aug 05 '22 12:08 nitzanfarhi

I will also add that this occurs in general when chars like \u2028 exist since they are considered as line breaks.

nitzanfarhi avatar Aug 05 '22 12:08 nitzanfarhi