socketstream/socketstream — Issue #138: Asset manager crashes because .serve is called before ssClient is initialized
Author: nponeccop
Created: 2012-02-09 21:11:28+00:00
State: open

The problem appears from time to time. The reason for crash is `Client.html` method attempting to read a property of `ssClient` when `ssClient` is `null`.

It seems that `.serve` method in `index.coffee` is called before `.load`, `load` is not called at all or `null` is passed to it. What do you think could happen?

```
TypeError: Cannot read property 'html' of null
at Client.html (/home/ics/node_modules/socketstream/src/client_asset_manager/client.coffee:91:21)
at Client.htmlFromCache (/home/ics/node_modules/socketstream/src/client_asset_manager/client.coffee:63:23)
at ServerResponse.serve (/home/ics/node_modules/socketstream/src/client_asset_manager/index.coffee:34:21)
at Object. (/home/ics/app.js:35:7)
at nextMiddleware (/home/ics/node_modules/connect/lib/middleware/router.js:175:25)
at param (/home/ics/node_modules/connect/lib/middleware/router.js:183:16)
at pass (/home/ics/node_modules/connect/lib/middleware/router.js:191:10)
at Object.router [as handle] (/home/ics/node_modules/connect/lib/middleware/router.js:197:6)
at next (/home/ics/node_modules/connect/lib/http.js:203:15)
at Object.bodyParser [as handle] (/home/ics/node_modules/connect/lib/middleware/bodyParser.js:88:61)
```