Nontrivial topology in higher spin gravity