Implement error checking in verify command to avoid dereferencing null pointer