Changeset - 1ae14a2ceba0
[Not reviewed]
default
0 1 0
Mads Kiilerich - 10 years ago 2015-07-20 15:11:42
madski@unity3d.com
changeset: make code more stable against unexpected comments

Avoid passing None to the template in comments. This makes the code more
correct and fixes a crash seen while hacking, probably never seen in the wild.
1 file changed with 2 insertions and 1 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/changeset.py
Show inline comments
 
@@ -232,25 +232,26 @@ class ChangesetController(BaseRepoContro
 
                            c.db_repo.repo_id, changeset.raw_id)])
 

	
 
                # Changeset comments
 
                comments.update((com.comment_id, com)
 
                                for com in ChangesetCommentsModel()
 
                                .get_comments(c.db_repo.repo_id,
 
                                              revision=changeset.raw_id))
 

	
 
                # Status change comments - mostly from pull requests
 
                comments.update((st.changeset_comment_id, st.comment)
 
                                for st in ChangesetStatusModel()
 
                                .get_statuses(c.db_repo.repo_id,
 
                                              changeset.raw_id, with_revisions=True))
 
                                              changeset.raw_id, with_revisions=True)
 
                                if st.changeset_comment_id is not None)
 

	
 
                inlines = ChangesetCommentsModel()\
 
                            .get_inline_comments(c.db_repo.repo_id,
 
                                                 revision=changeset.raw_id)
 
                c.inline_comments.extend(inlines)
 

	
 
            c.changes[changeset.raw_id] = []
 

	
 
            cs2 = changeset.raw_id
 
            cs1 = changeset.parents[0].raw_id if changeset.parents else EmptyChangeset().raw_id
 
            context_lcl = get_line_ctx('', request.GET)
 
            ign_whitespace_lcl = ign_whitespace_lcl = get_ignore_ws('', request.GET)
0 comments (0 inline, 0 general)