Commit 73876bdc authored by Andrea Azzarone's avatar Andrea Azzarone 🚴 Committed by Carlos Soriano

window-slot: Don't initialize extra widgets if content view is not yet set

The signal 'trash-state-changed' could be emitted by NautilusTrashMonitor while
a NautilusWindowSlot is still initializing the content view. In this case, don't
show/hide extra location widgets to avoid deferencing invalid memory. They will
be created anyway once the content view has been set.

Closes: #890
Closes: #862
parent 6114cb85
Pipeline #69291 passed with stages
in 9 minutes and 30 seconds
......@@ -2696,10 +2696,15 @@ trash_state_changed_cb (NautilusTrashMonitor *monitor,
{
GFile *location;
NautilusDirectory *directory;
NautilusView *view;
location = nautilus_window_slot_get_current_location (user_data);
view = nautilus_window_slot_get_current_view (user_data);
if (location == NULL)
/* The signal 'trash-state-changed' could be emitted by NautilusTrashMonitor
* while a NautilusWindowSlot is still initializing the content view.
*/
if (location == NULL || view == NULL)
{
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment