Fix NPE in purge command

Signed-off-by: Co0sh <coosheck@gmail.com>