fabric8io/fabric8 — pull request #845 by hekonsek (2014-03-05 21:07:04+00:00)
Title: Fixed NPE in the Create command (when default data is passed).

Hi,

Currently `zk:create /fabric/foo` command throws `NullPointerException` if executed. This happens when `createCommand.data` is empty (it can be, as passing initial data to the created node is optional) and we try to read bytes from it `nodeData.getBytes()`.

I decided to call `CreateBuilder.create(path)` method if initial data is empty. The latter method sets default Curator's initial data on the node (i.e. client IP address). I considered passing empty byte array there (`CreateBuilder.create(path, new byte[0])`), but decided to stick to the Curator default value to consequently use Curator API in the Karaf commands.

Cheers.