Visual: value was null

Hi,

Fuse 1.4.0,
MacOS Sierra 10.12.6

I’ve has some issues with an “visual: value was null” lately, making the preview to crash. The message is as follows:

Error: Uno.ArgumentNullException: visual: value was null
   at Fuse.VisualEventArgs..ctor(Fuse.Visual)
   at Fuse.Triggers.Actions.Callback.Perform(Fuse.Node)
   at Fuse.Triggers.Actions.TriggerAction.PerformFromNode(Fuse.Node)
   at Fuse.Triggers.Trigger.DeferredItem.Perform()
   at Fuse.UpdateAction.Invoke()
   at Fuse.UpdateManager.ProcessDeferredActions(Fuse.Stage,Uno.Collections.List<Uno.Exception>&)
   at Fuse.UpdateManager.Update(Fuse.Stage)
   at Fuse.UpdateManager.ProcessStages()
   at Fuse.UpdateManager.Update()
   at Fuse.App.OnUpdate()
   at Outracks.Simulator.Client.Application.OnUpdate()
   at Fuse.App.OnTick(object,Uno.Platform.TimerEventArgs)
   at Uno.Platform.Display.OnTick(Uno.Platform.TimerEventArgs)
   at Uno.Platform.Displays.TickAll(Uno.Platform.TimerEventArgs)

After a restart, it usually starts working again, but after some time the error eventually appears again. What is a typical cause for this behaviour? I do not get any message about where this issue might be located, nor am I able to find any visuals that is not closed or things like that.

Thanks!

There is no “typical cause” for something like that. As far as I looked, I only found this other thread where a similar issue was reported. Perhaps that gives you a clue on what’s causing the behaviour.

Other than that, we would need to see a complete project that reproduces the crash.

We were having two files using Activated Handler through Callback, causing this error. Getting rid of Callback removed the error. Callback seem to behave a little funky in this case. Maybe it is not even meant to be used like this in the first place.

Just though I should resolve this issue, in case anyone else is scratching their heads.

Codewise this means changing from this:

<Activated>
    <Callback Handler="{onActivated}"/>
</Activated>

To this:

<Activated Handler="{onActivated}"/>

@Terje: We’d still be very interested in seeing how you triggered this problem in the first place. As far as I can see, this should only be able to trigger if you have an Activated rooted on something that doesn’t have a Visual parent. But considering that RootViewport is a Visual, and is always the root of the application, this should never be possible. Something really odd seems to be going on here.

My best bet would be that a node was unrooted while there was a somehow pending deferred activated-event, but I can’t see how that could happen either. So I’m probably missing something, but it’s a bit hard to deal with without seeing an example.

Sure thing! What would be the preferred way of getting a copy of the source code privately?

Terje Mikalsen wrote:

Sure thing! What would be the preferred way of getting a copy of the source code privately?

@Terje: you can put it here.

Done! Thank you, @Uldis

Something on that? i’m facing the very same error.