diff options
author | Alan McGovern <alan.mcgovern@gmail.com> | 2012-03-09 19:12:03 +0400 |
---|---|---|
committer | Alan McGovern <alan.mcgovern@gmail.com> | 2012-03-09 19:12:03 +0400 |
commit | cc9ebed858ff7bd17ba882353c7b8b3dc837cad5 (patch) | |
tree | 561ccb876be82f1e715d9ae884b3145e3372c8fe /main/src/addins/VersionControl | |
parent | 951fdc6d82c775bd4dc4bd95646d41bec0252c2d (diff) |
[VersionControl] Prevent a potential null reference exception
If the diff cannot be calculated for some reason, null can be returned.
Detect this and treat it the same as if a diff was empty.
Diffstat (limited to 'main/src/addins/VersionControl')
-rw-r--r-- | main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/StatusView.cs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/StatusView.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/StatusView.cs index ef18eebdca..9023f959ca 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/StatusView.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/StatusView.cs @@ -968,7 +968,7 @@ namespace MonoDevelop.VersionControl.Views }); } else if (info.Exception != null) { text = new [] { GettextCatalog.GetString ("Could not get diff information. ") + info.Exception.Message }; - } else if (string.IsNullOrEmpty (info.Diff.Value.Content)) { + } else if (info.Diff.Value == null || string.IsNullOrEmpty (info.Diff.Value.Content)) { text = new [] { GettextCatalog.GetString ("No differences found") }; } else { text = info.Diff.Value.Content.Split ('\n'); |