lorenwest/node-config — pull request #123 by roncli (2014-07-22 21:28:52+00:00)
Title: Fix empty YAML file causing crash with latest js-yaml

When tracking configuration sources, an assumption is made that `configObject` is going to always be an object. With the latest js-yaml, this assumption is no longer true, as an empty YAML file will return `undefined` when parsed.

Attempting to serialize `undefined` into a JSON string by using `JSON.stringify()` is legal, also returning `undefined`. However, attempting to get the `length` property of `undefined` is an error.

This request eliminates this assumption by ensuring that configObject is actually an object before attempting to get the length of the serialized object.