mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Fix respath null errors (#3989)
This commit is contained in:
@@ -12,7 +12,7 @@ namespace Robust.Client.ResourceManagement
|
||||
/// <summary>
|
||||
/// Fallback resource path if this one does not exist.
|
||||
/// </summary>
|
||||
public virtual ResPath Fallback => default;
|
||||
public virtual ResPath? Fallback => null;
|
||||
|
||||
/// <summary>
|
||||
/// Disposes this resource.
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace Robust.Client.ResourceManagement
|
||||
{
|
||||
Logger.Error(
|
||||
$"Exception while loading resource {typeof(T)} at '{path}', resorting to fallback.\n{Environment.StackTrace}\n{e}");
|
||||
return GetResource<T>(_resource.Fallback, false);
|
||||
return GetResource<T>(_resource.Fallback.Value, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -141,7 +141,7 @@ namespace Robust.Client.ResourceManagement
|
||||
throw new InvalidOperationException($"Resource of type '{typeof(T)}' has no fallback.");
|
||||
}
|
||||
|
||||
fallback = GetResource<T>(res.Fallback, useFallback: false);
|
||||
fallback = GetResource<T>(res.Fallback.Value, useFallback: false);
|
||||
_fallbacks.Add(typeof(T), fallback);
|
||||
return (T) fallback;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Robust.Client.ResourceManagement
|
||||
/// </summary>
|
||||
public sealed class RSIResource : BaseResource
|
||||
{
|
||||
public override ResPath Fallback => new("/Textures/error.rsi");
|
||||
public override ResPath? Fallback => new("/Textures/error.rsi");
|
||||
|
||||
public RSI RSI { get; private set; } = default!;
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Robust.Client.ResourceManagement
|
||||
public sealed class TextureResource : BaseResource
|
||||
{
|
||||
private OwnedTexture _texture = default!;
|
||||
public override ResPath Fallback => new("/Textures/noSprite.png");
|
||||
public override ResPath? Fallback => new("/Textures/noSprite.png");
|
||||
|
||||
public Texture Texture => _texture;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user