fix NPE exception. Converted to Transaction exception.
small change
Merge pull request #1917 from sancar/fix/NPEinTxn/master

fix NPE exception. Converted to Transaction exception.