Fixed Null-pointer exception

Fixed null-pointer exception when no commands were added to transaction