Can't display image from webpage

Hello, I’m a new member so I’m sorry if this is in the wrong place.

I’ve been working with and learning about Unity for the past few months now and I’ve been making good progress so far along with a book titled “Unity in Action”.

Right now, I’m learning about connecting my game to the internet and I’m trying to download an image from a webpage and display it onto a 3D cube I flattened to act like a billboard.

Unfortunately, even though it seems like I did everything right according to my text, I keep getting a NullReferenceException. Now my experience with programming is telling me that this exception is being thrown because it’s trying to reference something that’s empty or isn’t currently existing but I still can’t figure out the problem.

I’ve the code separated into different scripts named as different managers to communicate with each other. I was orignally going to upload the scripts using the code tags but since there are multiple scripts I thought I’d save time and provide links to the scripts.

Here’s the script called NetworkService; This code takes requests from other scripts using coroutines and the script sends the HTTP reponse back from what ever other script made the request:

As you can see, one of its abilities is that it’s supposed to retrieve image information from a webpage. While trying to debug, I made sure that the URL was right and it was when I pasted it into my browser.

The next script is ImagesManager; this script actually sends a request to the first script:

This script is also a part of another script that keeps track of all of the other manager scripts:

Lastly, is the code that’s actually supposed to display the image and it’s attached to the 3D object in the scene that’s supposed to display the image. This is where the exception is coming from. Specifically at line 9:

What could I be doing wrong?

Might I suggest posting the error, I presume it makes clear what is null (eg. could it be that your method is being called before initialisation and the renderer or it’s material is null, or is the texture2D null?)