GNOME Bugzilla – Bug 677680
Crash in focus() because of cursor_child being null
Last modified: 2012-06-11 08:01:33 UTC
Atm we have: /* TODO: Handle null cursor child */ I'm experiencing a crash because of this. I have no idea what's the right way to handle this but an early return fixes my crash.
Created attachment 215914 [details] [review] fix style of focus() No semantic change, I just add working on miss aligned code.
Created attachment 215915 [details] [review] focus: early return if cursor_child is null
Created attachment 215916 [details] [review] fix style of focus() No semantic change, I just hate working on miss aligned code.
I don't see any missalignment? Are you using 8 space tabs? Also, i think returning early is not really right, or at least it doesn't go with the rest of the code very nicely. Just don't set recurse_into if cursor_child is null. That will avoid the crash, and then set focus_into to false which will make us return.
Created attachment 215926 [details] [review] focus: cope with cursor_child being null
(In reply to comment #4) > I don't see any missalignment? Are you using 8 space tabs? The line I changed are tabs aligned while most the of file if spaces aligned. > Also, i think returning early is not really right, or at least it doesn't go > with the rest of the code very nicely. > > Just don't set recurse_into if cursor_child is null. That will avoid the crash, > and then set focus_into to false which will make us return. done.
Created attachment 216087 [details] [review] focus: cope with cursor_child being null
Attachment 215916 [details] pushed as 6adf9cb - fix style of focus() Attachment 216087 [details] pushed as f43820e - focus: cope with cursor_child being null
As for the indentation, it uses 8 space tabs, and spaces wherever the indentation is less than 8 spaces (obviously).