trq-2378 Check ptask for NULL before dereferencing it.