Null Reference Exception + Lost Capture error

I have the following error:

System.NullReferenceException: Object reference not set to an instance of an object
  at Fuse.Gestures.LinearRangeBehavior.OnLostCapture ()

It appears to be raised sometimes when I’m trying to interact with a slider on Fuse Preview on the computer.
Also on that note, the ‘Restart’ button that appears on the preview can not be interacted with.

Fuse version v1.1.0 (build 13808)
macOS 10.12.5

Hi Zia,

could you please share a complete, minimal repro that manifests the issue? We would like to have something that we can test.

Hi Uldis,
Here’s my UX markup for the slider I’m building. What happens, is that when I interact with the slider (sliding it forwards and backwards) on Fuse Preview (on computer) I occasionally get the error I mentioned in my previous post.

Thanks

<RangeControl Margin="26,2,36,2" >
                       
             <LinearRangeBehavior />
             <Panel Height="50" Width="50" HitTestMode="LocalBoundsAndChildren" ux:Name="thumb" Alignment="Left">
                            <Circle Anchor="0%,50%" Alignment="Left" Color="#fffd" Width="30" Height="30" HitTestMode="LocalBoundsAndChildren">
                            </Circle>
             </Panel>
                       
             <Panel ux:Name="elapsedValue" HitTestMode="None">
                            <Text Value="Slider Value" X="x(thumb)+10" Y="55"/>
             </Panel>
             <ProgressAnimation>
                            <Move Target="thumb" X="1" RelativeTo="ParentSize" />
                            <Move Target="elapsedValue" X="1" RelativeTo="ParentSize" />                                
             </ProgressAnimation>
</RangeControl>


Thanks for the code, that will help.

We have seen something similar before in other gestures, so I have to ask - it’s just the error that is being thrown, and everything appears to be working just fine, correct?

And is it only happening on local preview; device previews and builds are not throwing anything?

You’re most welcome.

The Fuse preview on the computer breaks and I am presented with an “Oops! Something went wrong here” page, the page has a Restart button on the bottom, which does not work. If I try to interact with the page (even hover), more errors are raised, they all start with the following:

System.NullReferenceException: Object reference not set to an instance of an object
  at Fuse.Gestures.LinearRangeBehavior.OnLostCapture () <0x2befd048 

My device previews have not broken yet.

Alright, that clears it up.

Do you think you could share a full project for testing this? The code above didn’t crash on me at least, so maybe it’s related to how you use the RangeControl / other layout elements.

Thanks Uldis.
The above range control is enclosed in the following layout elements. To try and reproduce this, try and drag your mouse out of the Fuse Preview window and see if you are able to reproduce the problem. In the meantime, I’ll do an uno clean and a fresh install of Fuse just to be sure.

<DockPanel>
    <ScrollView>
            <StackPanel>
                  <Panel>
                       <!--  RangeControl goes here ->
                  </Panel>
            </StackPanel>
    </ScrollView>
</DockPanel>