Hi. Please put your code in code tags next time.

Search your code for loose values and null. Any value that isn't preset/determined is at hazard for an NPE. I would suggest trying the good old..
...