indexzero/winston-riak — pull request #2 by markbao (2012-01-10 00:29:34+00:00)
Title: Fix bug where metac.level results in a 'cannot set property' exception

What I tried:

```
winston.log('info', 'log message')
```

What resulted:

```
/app/node_modules/winston-riak/lib/winston-riak.js:58
metac.level = level;
^
TypeError: Cannot set property 'level' of null
```

`metac` uses `winston.clone` to clone the `meta` parameter, which is optional. When `meta` is null, `metac` is null, and then `metac.level` throws the above error.

This tiny bugfix checks whether `metac` is null or not, and makes it an empty object if null.