# Binding stroke color

**URL:** <https://forums.fusetools.com/t/binding-stroke-color/2098>\
**Category:** Bug Reports\
**Created:** [October 26, 2016, 4:18pm UTC](https://forums.fusetools.com/t/binding-stroke-color/2098 "2016-10-26T16:18:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![LuisRodriguezLD](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/luisrodriguezld/32/616_2.png) [@LuisRodriguezLD](https://forums.fusetools.com/u/LuisRodriguezLD)\
**Post date:** [October 26, 2016, 4:18pm UTC](https://forums.fusetools.com/t/binding-stroke-color/2098/1 "2016-10-26T16:18:20Z")

</div>

Hello.  
I am currently using Fuse Ver 0.28.1 on MacOS Sierra.

I´ve been getting the following error since 0.27.1

```auto
System.NullReferenceException: Object reference not set to an instance of an object at Fuse.Drawing.Stroke

```

when trying to bind a stroke color to an `Observable`

@Knatten confirmed the bug using the following code

````auto
<App>
    <JavaScript>
        module.exports = {color: "#000"}
    </JavaScript>

    <Rectangle Width="200" Height="50" Color="Blue">
        <Stroke Width="5" Color="{color}" />
    </Rectangle>
</App>```

Just to let you know, in 0.28.1 it is still not working
````

---

<div class="post-metadata">

**Author:** ![Kristian\_Hasselknipp](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/kristian_hasselknipp/32/549_2.png) [@Kristian\_Hasselknipp](https://forums.fusetools.com/u/Kristian_Hasselknipp)\
**Post date:** [October 28, 2016, 8:14am UTC](https://forums.fusetools.com/t/binding-stroke-color/2098/2 "2016-10-28T08:14:12Z")

</div>

This does indeed seem like a bug.

In the meantime, here is a workaround:

```auto
<App>
	<JavaScript>
		module.exports = {color: "#f0f"}
	</JavaScript>

	<Rectangle Width="200" Height="50" Color="Blue">
		<DataBinding Target="myStroke.Color" Key="color" />
		<Stroke ux:Name="myStroke" Width="5" Color="#000"/>
	</Rectangle>
</App>

```

This works because i’ve given a “default” value to the Stroke which avoids the null reference.

---

<div class="post-metadata">

**Author:** ![LuisRodriguezLD](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/luisrodriguezld/32/616_2.png) [@LuisRodriguezLD](https://forums.fusetools.com/u/LuisRodriguezLD)\
**Post date:** [November 10, 2016, 8:09pm UTC](https://forums.fusetools.com/t/binding-stroke-color/2098/3 "2016-11-10T20:09:08Z")

</div>

FYI: This has been fixed since Fuse 0.29 Thanks!
