Fix possible crashes by catching char* exceptions from gitdll