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

Commit 41850a9

Browse files
committed
Fix CA errors.
1 parent e89145e commit 41850a9

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/GitHub.App/Services/PullRequestEditorService.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,8 +420,7 @@ bool FocusExistingDiffViewer(
420420
leftBufferInfo.Session.PullRequest.Number == session.PullRequest.Number &&
421421
leftBufferInfo.CommitSha == mergeBase)
422422
{
423-
windowFrame.Show();
424-
return true;
423+
return ErrorHandler.Succeeded(windowFrame.Show());
425424
}
426425
}
427426
}
@@ -563,8 +562,13 @@ static string GetAbsolutePath(IPullRequestSession session, IPullRequestSessionFi
563562
static IDifferenceViewer GetDiffViewer(IVsWindowFrame frame)
564563
{
565564
object docView;
566-
frame.GetProperty((int)__VSFPROPID.VSFPROPID_DocView, out docView);
567-
return (docView as IVsDifferenceCodeWindow)?.DifferenceViewer;
565+
566+
if (ErrorHandler.Succeeded(frame.GetProperty((int)__VSFPROPID.VSFPROPID_DocView, out docView)))
567+
{
568+
return (docView as IVsDifferenceCodeWindow)?.DifferenceViewer;
569+
}
570+
571+
return null;
568572
}
569573

570574
static IDisposable OpenInProvisionalTab()

src/GitHub.App/Services/PullRequestService.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
using LibGit2Sharp;
1818
using GitHub.Logging;
1919
using GitHub.Extensions;
20+
using static System.FormattableString;
2021

2122
namespace GitHub.Services
2223
{
@@ -680,7 +681,7 @@ static string CalculateTempFileName(string relativePath, string commitSha, Encod
680681
var key = relativeDir + '|' + encoding.WebName;
681682
var relativePathHash = key.GetSha256Hash();
682683
var tempDir = Path.Combine(Path.GetTempPath(), "GitHubVisualStudio", "FileContents", relativePathHash);
683-
var tempFileName = $"{Path.GetFileNameWithoutExtension(relativePath)}@{commitSha}{Path.GetExtension(relativePath)}";
684+
var tempFileName = Invariant($"{Path.GetFileNameWithoutExtension(relativePath)}@{commitSha}{Path.GetExtension(relativePath)}");
684685
return Path.Combine(tempDir, tempFileName);
685686
}
686687

0 commit comments

Comments
 (0)