Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix NullReferenceException
  • Loading branch information
chris-blackman committed Apr 6, 2022
commit aa9a7aebe8c86e9043ce08730aa5d7e4161969f0
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ public T GetResource<T>(string key)
/// <returns>The resource that was removed, if any</returns>
public T RemoveResource<T>(string key)
{
if (_resources.TryGetValue(key, out var objResource))
if (_resources != null && _resources.TryGetValue(key, out var objResource))
{
_resources.Remove(key);
if (objResource is T resource)
Expand All @@ -255,7 +255,7 @@ public T RemoveResource<T>(string key)
public T RemoveAndDisposeResource<T>(string key)
where T : IDisposable
{
if (_resources.TryGetValue(key, out var objResource))
if (_resources != null && _resources.TryGetValue(key, out var objResource))
{
_resources.Remove(key);
if (objResource is T resource)
Expand Down