Fix #7835, opening WMS layer properties causes crash