Empty Url and File for Image crash

Hey, fuse, OSX. Affected all previews, most probably release builds too.

Link to full repro with in-line comments, .unoproj file and bundled image: https://dl.dropboxusercontent.com/u/11750787/image-crash-test.zip

Not sure exactly what should happen when one data-bounds Url or File attribute to an empty string, but the app probably should not crash. You’ll see in the code that there are two different crash cases, one of them severe since the app has to be restarted after that. One is when going from local to remote image source, and second is the other way around.

Source code for reference:

        var Observable = require('FuseJS/Observable');

        var remote = Observable(false);
        var imageUrl = Observable('http://www.hmtk.com/wp-content/uploads/2007/06/techsupportcat.jpg');
        var imagePath = Observable('local.jpg');

        function showLocalImage() {
            // remote.value = false; // if you uncomment this line, it CRASHES COMPLETELY
            imageUrl.value = ''; // this is where the problem really lies - the Url gets cleared before the UX component switches over to the local picture
            imagePath.value = 'local.jpg';
            remote.value = false;

        function showRemoteImage() {
            // remote.value = true; // if you uncomment this line, it DOES NOT crash
            imagePath.value = ''; // this is where the problem really lies - the Path gets cleared before the UX component switches over to the remote picture
            imageUrl.value = 'http://www.hmtk.com/wp-content/uploads/2007/06/techsupportcat.jpg';
            remote.value = true; // if you switch the remote after setting the Url, then it DOES crash a little

        module.exports = {
            'remote': remote,
            'imageUrl': imageUrl,
            'imagePath': imagePath,
            'showLocalImage': showLocalImage,
            'showRemoteImage': showRemoteImage

    <Panel ux:Class="PictureContainer">
        <string ux:Property="ImageUrl" />
        <FileSource ux:Property="ImagePath" />
        <bool ux:Property="Remote" />
        <WhileTrue Value="{Property this.Remote}">
            <Image Url="{Property this.ImageUrl}" />
        <WhileFalse Value="{Property this.Remote}">
            <Image File="{Property this.ImagePath}" />

    <ClientPanel Background="#eee">
        <StackPanel Alignment="Center" ItemSpacing="10">
            <StackPanel Orientation="Horizontal" ItemSpacing="10">
                <Panel Width="100" Height="40" HitTestMode="LocalBoundsAndChildren">
                        <Callback Handler="{showLocalImage}" />
                    <Text Alignment="Center" Value="Show Local" />
                    <Rectangle Fill="#fff" CornerRadius="5">
                        <Stroke Width="1" Color="#aaa" />
                <Panel Width="100" Height="40" HitTestMode="LocalBoundsAndChildren">
                        <Callback Handler="{showRemoteImage}" />
                    <Text Alignment="Center" Value="Show Remote" />
                    <Rectangle Fill="#fff" CornerRadius="5">
                        <Stroke Width="1" Color="#aaa" />
            <Panel Width="200" Height="200" ClipToBounds="true">
                <PictureContainer Remote="{remote}" ImageUrl="{imageUrl}" ImagePath="{imagePath}" />


Sorry for the slow response, we have created a ticket for this.

And thanks for the bug report, we appreciate it :slight_smile: