not sure if I understand how we can get into this situation. If the map has no layers left, there won't be a layer in the tree to have a context menu. Or am I missing something here?