Added a null check for the stream variable and security key. It appears that in some scenarios 
a request can come in from the client even though the component has already been detached from
the server side.