java.lang.NullPointerException: Cannot invoke method createCell() on null object

Hi ,
I am also facing java.lang.NullPointerException: Cannot invoke method createCell() on null object issue, I figured out when it is happening for me. When I am trying to write data on empty cell then this error comes up.
What I did was ,manually edited the cell in sheet with some random text, then I ran script then it is able to write the data to cell through scripts.

But How can I write data through script on empty cell too, please suggest me, it would be great help to me.

Thanks
Shiva