[OFBIZ-3879] Patch from the jira issue resolves the problem. Now start rendering invoice only if valid data if found in the database. 
Code needs reformatting.
Thanks Deepak Dixit for the contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1626399 13f79535-47bb-0310-9956-ffa450edef68