GNOME Bugzilla – Bug 773499
window: check for an active slot when updating cursor
Last modified: 2016-11-13 20:19:00 UTC
When updating the cursor, the existence of an active window slot is assumed when checking if it allows stopping. This can cause a crash if the last view is closed while it is still loading.
Created attachment 338442 [details] [review] window: check for an active slot when updating cursor
Not sure how high in the stack it would make most sense, but it works.
+ Trace 236773
Review of attachment 338442 [details] [review]: Oh yeah, not sure why this was an assumption before. Thanks! ::: src/nautilus-window.c @@ +797,3 @@ slot = nautilus_window_get_active_slot (window); + if (slot != NULL && although for some time I though "pointer != NULL" was more explicit, it's recommended in the gnu guide (cannot find the reference now) to use if (pointer) instead. But I like the explicitness, so I I guess this is fine. I have been back and forth on this one for some time now.
> > although for some time I though "pointer != NULL" was more explicit, it's > recommended in the gnu guide (cannot find the reference now) to use if > (pointer) instead. > But I like the explicitness, so I I guess this is fine. I have been back and > forth on this one for some time now. To clarify this is a case whether I'm not sure it is explicitness or redundant, since it's something the C standard supports and documents. But it's not in other languages, and that makes me lend more to the side of using pointer != NULL although in C it is.
Attachment 338442 [details] pushed as 4b13594 - window: check for an active slot when updating cursor
*** Bug 774375 has been marked as a duplicate of this bug. ***