Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit cfcdf49

Browse files
authored
Merge branch 'master' into fixes/test
2 parents 79693eb + cddd3a4 commit cfcdf49

File tree

3 files changed

+22
-8
lines changed

3 files changed

+22
-8
lines changed

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,9 @@
22

33
## Notices
44

5-
### VS 2017 v15.3 users, please read
5+
### If you are having issues with the installer, please read
66

7-
If you need to downgrade or uninstall the extension, **do not use** ***Revert*** in Visual Studio 2017 15.3. Instead, manually uninstall the extension with the steps listed in https://github.com/github/VisualStudio/issues/1206#issuecomment-326558902
8-
9-
If you have a corrupted extension cache, steps for fixing it are in https://github.com/github/VisualStudio/issues/1206#issuecomment-326053090
10-
11-
The Visual Studio 2017 15.3 installer [has a bug](https://github.com/github/VisualStudio/issues/1206) that causes a corruption of the installed extensions data when you revert an installation of the extension (see also [this MS issue](https://developercommunity.visualstudio.com/content/problem/102178/error-installing-github-extension.html)). Until VS 2017 15.4 comes out, **do not use Revert in** ***Extensions and Updates***.
7+
If you need to upgrade, downgrade, or uninstall the extension, and are having problems doing so, refer to this issue: https://github.com/github/VisualStudio/issues/1394 which details common problems and solutions when using the installer.
128

139
### The location of the submodules has changed as of 31-01-2017
1410

src/GitHub.Exports/Models/DiffUtilities.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ public static class DiffUtilities
1313

1414
public static IEnumerable<DiffChunk> ParseFragment(string diff)
1515
{
16+
Guard.ArgumentNotNull(diff, nameof(diff));
17+
1618
var reader = new LineReader(diff);
1719
string line;
1820
DiffChunk chunk = null;

src/GitHub.InlineReviews/Services/DiffService.cs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,15 @@ public async Task<IReadOnlyList<DiffChunk>> Diff(
3232
string path)
3333
{
3434
var patch = await gitClient.Compare(repo, baseSha, headSha, path);
35-
return DiffUtilities.ParseFragment(patch).ToList();
35+
36+
if (patch != null)
37+
{
38+
return DiffUtilities.ParseFragment(patch).ToList();
39+
}
40+
else
41+
{
42+
return new DiffChunk[0];
43+
}
3644
}
3745

3846
/// <inheritdoc/>
@@ -44,7 +52,15 @@ public async Task<IReadOnlyList<DiffChunk>> Diff(
4452
byte[] contents)
4553
{
4654
var changes = await gitClient.CompareWith(repo, baseSha, headSha, path, contents);
47-
return DiffUtilities.ParseFragment(changes.Patch).ToList();
55+
56+
if (changes?.Patch != null)
57+
{
58+
return DiffUtilities.ParseFragment(changes.Patch).ToList();
59+
}
60+
else
61+
{
62+
return new DiffChunk[0];
63+
}
4864
}
4965
}
5066
}

0 commit comments

Comments
 (0)