mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 11:42:56 +08:00
Merge pull request #16282 from peppy/fix-kiai-drawable-nullref
Fix null reference causing crash in `KiaiFlashingDrawable`
This commit is contained in:
commit
cbb62fab26
@ -7,6 +7,8 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Game.Beatmaps.ControlPoints;
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
|
|
||||||
|
#nullable enable
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Skinning.Legacy
|
namespace osu.Game.Rulesets.Osu.Skinning.Legacy
|
||||||
{
|
{
|
||||||
internal class KiaiFlashingDrawable : BeatSyncedContainer
|
internal class KiaiFlashingDrawable : BeatSyncedContainer
|
||||||
@ -15,18 +17,18 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
|
|||||||
|
|
||||||
private const float flash_opacity = 0.3f;
|
private const float flash_opacity = 0.3f;
|
||||||
|
|
||||||
public KiaiFlashingDrawable(Func<Drawable> creationFunc)
|
public KiaiFlashingDrawable(Func<Drawable?> creationFunc)
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
|
|
||||||
Children = new[]
|
Children = new[]
|
||||||
{
|
{
|
||||||
creationFunc.Invoke().With(d =>
|
(creationFunc.Invoke() ?? Empty()).With(d =>
|
||||||
{
|
{
|
||||||
d.Anchor = Anchor.Centre;
|
d.Anchor = Anchor.Centre;
|
||||||
d.Origin = Anchor.Centre;
|
d.Origin = Anchor.Centre;
|
||||||
}),
|
}),
|
||||||
flashingDrawable = creationFunc.Invoke().With(d =>
|
flashingDrawable = (creationFunc.Invoke() ?? Empty()).With(d =>
|
||||||
{
|
{
|
||||||
d.Anchor = Anchor.Centre;
|
d.Anchor = Anchor.Centre;
|
||||||
d.Origin = Anchor.Centre;
|
d.Origin = Anchor.Centre;
|
||||||
|
Loading…
Reference in New Issue
Block a user