Resolves: fdo#79161 sidebar crash on deactivating

Change-Id: I0d559bd8c16243fdc398f6bff0aa915a83a29dff
(cherry picked from commit f3c9e8471a83e6ceb9258d3a4ab7d3354adcfb3a)