Skip to content

Commit

Permalink
fix: NDMF console breaks when an extension context throws an exception
Browse files Browse the repository at this point in the history
Closes: #445
  • Loading branch information
bdunderscore committed Oct 20, 2024
1 parent fdb96a6 commit b2ae8b2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed
- [#459] "Proxy object was destroyed improperly! Resetting pipeline..." error appears frequently

- [#460] Preview system fails to recover when the primary proxy is destroyed
- [#462] NDMF console fails to appear when an ExtensionContext throws an exception

### Changed

Expand Down
2 changes: 1 addition & 1 deletion Editor/ErrorReporting/UI/ErrorReportWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ private void UpdateContents()
_errorList.style.display = DisplayStyle.Flex;
_errorList.Clear();

var errors = _report.Errors.OrderBy(e => e.Plugin.DisplayName).ToList();
var errors = _report.Errors.OrderBy(e => e.Plugin?.DisplayName).ToList();
PluginBase lastPlugin = null;

foreach (var error in errors)
Expand Down
7 changes: 5 additions & 2 deletions Editor/ErrorReporting/UI/GroupHeader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public GroupHeader(PluginBase plugin)
var titleElem = this.Q<Label>("group-title");
var imageElem = this.Q<Image>("group-logo");

if (plugin.LogoTexture != null)
if (plugin?.LogoTexture != null)
{
imageElem.image = plugin.LogoTexture;
titleElem.style.display = DisplayStyle.None;
Expand All @@ -36,10 +36,13 @@ public GroupHeader(PluginBase plugin)
imageElem.style.height = height;
#endif
}
else
else if (plugin != null)
{
imageElem.style.display = DisplayStyle.None;
titleElem.text = plugin.DisplayName;
} else {
imageElem.style.display = DisplayStyle.None;
titleElem.text = "???";
}
}
}
Expand Down

0 comments on commit b2ae8b2

Please sign in to comment.