# HttpImageSource runtime exception

**URL:** <https://forums.fusetools.com/t/httpimagesource-runtime-exception/2528>\
**Category:** Bug Reports\
**Created:** [February 2, 2016, 2:53pm UTC](https://forums.fusetools.com/t/httpimagesource-runtime-exception/2528 "2016-02-02T14:53:55Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jveres](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/jveres/32/545_2.png) [@jveres](https://forums.fusetools.com/u/jveres)\
**Post date:** [February 2, 2016, 2:53pm UTC](https://forums.fusetools.com/t/httpimagesource-runtime-exception/2528/1 "2016-02-02T14:53:55Z")

</div>

`<Image Url="[https://pacdn.500px.org/6064290/2ba1f7c11b27ca906ed6c8a2da526096e12399e8/3.jpg?2"/&gt](https://pacdn.500px.org/6064290/2ba1f7c11b27ca906ed6c8a2da526096e12399e8/3.jpg?2"/&gt);`

gives runtime exception:

```auto
System.NullReferenceException: Object reference not set to an instance of an object
 at Fuse.Resources.HttpImageSourceImpl+BackgroundLoad.UIFailCallback () [0x00000] in <filename unknown>:0

```

---

<div class="post-metadata">

**Author:** ![jveres](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/jveres/32/545_2.png) [@jveres](https://forums.fusetools.com/u/jveres)\
**Post date:** [February 9, 2016, 12:03pm UTC](https://forums.fusetools.com/t/httpimagesource-runtime-exception/2528/2 "2016-02-09T12:03:44Z")

</div>

Just reporting that this issue has not been fixed yet.

---

<div class="post-metadata">

**Author:** ![jveres](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/jveres/32/545_2.png) [@jveres](https://forums.fusetools.com/u/jveres)\
**Post date:** [February 11, 2016, 9:41am UTC](https://forums.fusetools.com/t/httpimagesource-runtime-exception/2528/3 "2016-02-11T09:41:07Z")

</div>

Possible bug is in `BackgroundLoad`'s ctor where `_fail` doesn’t get assigned to the `fail` parameter.

There’s even an empty line for that:)

Every `UIFailCallback()` call then causes runtime exception because of calling `_fail(e)` where `_fail` is always `null`.

(I’m still curious however why `TextureLoader` fails in some cases.)

---

<div class="post-metadata">

**Author:** ![jveres](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/jveres/32/545_2.png) [@jveres](https://forums.fusetools.com/u/jveres)\
**Post date:** [February 22, 2016, 11:47am UTC](https://forums.fusetools.com/t/httpimagesource-runtime-exception/2528/4 "2016-02-22T11:47:12Z")

</div>

Could someone from the team reflect on this, please?

---

<div class="post-metadata">

**Author:** ![Anders\_Lassen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_lassen/32/522_2.png) [@Anders\_Lassen](https://forums.fusetools.com/u/Anders_Lassen)\
**Post date:** [February 24, 2016, 5:36pm UTC](https://forums.fusetools.com/t/httpimagesource-runtime-exception/2528/5 "2016-02-24T17:36:18Z")

</div>

Hi !

Sorry for the late reply. We have this issue on file with high priority. Someone will look at it shortly.

---

<div class="post-metadata">

**Author:** ![jveres](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/jveres/32/545_2.png) [@jveres](https://forums.fusetools.com/u/jveres)\
**Post date:** [February 24, 2016, 5:50pm UTC](https://forums.fusetools.com/t/httpimagesource-runtime-exception/2528/6 "2016-02-24T17:50:31Z")

</div>

Thanks Anders!

---

<div class="post-metadata">

**Author:** ![Anders\_Lassen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_lassen/32/522_2.png) [@Anders\_Lassen](https://forums.fusetools.com/u/Anders_Lassen)\
**Post date:** [February 24, 2016, 5:50pm UTC](https://forums.fusetools.com/t/httpimagesource-runtime-exception/2528/7 "2016-02-24T17:50:39Z")

</div>

Hi again!

This has now been fixed. There was two bugs:

1. The server doesn’t report this image as a content type `image/jpeg` as is normal, instead it reported the content type as "application/octet-stream`, which our texture loader didn’t handle. I’ve patched this up now.

2. The HttpImageSource implementation didn’t report the error correctly, and chose to crash instead of just silently logging the error.

Thanks for reporting, and thanks for your patience. This fix should roll out in about a week from now.

---

<div class="post-metadata">

**Author:** ![jveres](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/jveres/32/545_2.png) [@jveres](https://forums.fusetools.com/u/jveres)\
**Post date:** [February 26, 2016, 10:04am UTC](https://forums.fusetools.com/t/httpimagesource-runtime-exception/2528/8 "2016-02-26T10:04:05Z")

</div>

Many thanks!

---

<div class="post-metadata">

**Author:** ![jveres](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/jveres/32/545_2.png) [@jveres](https://forums.fusetools.com/u/jveres)\
**Post date:** [March 1, 2016, 5:36pm UTC](https://forums.fusetools.com/t/httpimagesource-runtime-exception/2528/9 "2016-03-01T17:36:55Z")

</div>

Please include the patch in the upcoming 0.10.x release. Just tried with the latest qa release and this super annoying bug is still there:(
