handling possible NPEs
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-stratos