Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure ResourceStore returns null rather than exception on null request #3139

Merged
merged 1 commit into from
Dec 25, 2019
Merged
Changes from all commits
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
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