mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-02 00:26:45 +00:00
Fix a git2 related crash when closing KiCad
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/20202
This commit is contained in:
parent
de09403b10
commit
bb62444fe9
@ -235,6 +235,9 @@ std::pair<std::set<wxString>,std::set<wxString>> KIGIT_COMMON::GetDifferentFiles
|
||||
std::set<wxString> modified_set;
|
||||
git_revwalk* walker = nullptr;
|
||||
|
||||
if( !m_repo )
|
||||
return modified_set;
|
||||
|
||||
if( git_revwalk_new( &walker, m_repo ) != GIT_OK )
|
||||
{
|
||||
wxLogTrace( traceGit, "Failed to create revwalker" );
|
||||
@ -304,6 +307,9 @@ std::pair<std::set<wxString>,std::set<wxString>> KIGIT_COMMON::GetDifferentFiles
|
||||
git_diff_options diff_opts;
|
||||
git_diff_init_options( &diff_opts, GIT_DIFF_OPTIONS_VERSION );
|
||||
|
||||
if( !diff_opts.flags || !m_repo || !parent_tree || !tree )
|
||||
continue;
|
||||
|
||||
if( git_diff_tree_to_tree( &diff, m_repo, parent_tree, tree, &diff_opts ) == GIT_OK )
|
||||
{
|
||||
size_t num_deltas = git_diff_num_deltas( diff );
|
||||
|
Loading…
Reference in New Issue
Block a user