Fix NPE when get taskValue before check task is released.
Cleanupo code.