Skip to content

Commit

Permalink
Merge pull request #3139 from peppy/fix-resourcestore-null-handling
Browse files Browse the repository at this point in the history
Ensure ResourceStore returns null rather than exception on null request
  • Loading branch information
smoogipoo authored Dec 25, 2019
2 parents d3612b4 + 8c1a421 commit 8a960c3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions osu.Framework/IO/Stores/ResourceStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ public virtual void RemoveStore(IResourceStore<T> store)
/// <returns>The object.</returns>
public virtual async Task<T> GetAsync(string name)
{
if (name == null)
return null;

var filenames = GetFilenames(name);

// required for locking
Expand Down Expand Up @@ -113,6 +116,9 @@ public virtual async Task<T> GetAsync(string name)
/// <returns>The object.</returns>
public virtual T Get(string name)
{
if (name == null)
return null;

var filenames = GetFilenames(name);

// Cache miss - get the resource
Expand All @@ -134,6 +140,9 @@ public virtual T Get(string name)

public Stream GetStream(string name)
{
if (name == null)
return null;

var filenames = GetFilenames(name);

// Cache miss - get the resource
Expand Down

0 comments on commit 8a960c3

Please sign in to comment.