[3130] in BarnOwl Developers
[barnowl/barnowl] 901cee: Don't segfault when you expunge all messages from ...
daemon@ATHENA.MIT.EDU (noreply@github.com)
Mon Jul 4 00:51:35 2011
Date: Sun, 3 Jul 2011 21:51:33 -0700
To: barnowl-dev@mit.edu
From: noreply@github.com
Branch: refs/heads/master
Home: https://github.com/barnowl/barnowl
Commit: 901cee9b7ebc203aee860a9c5fc3849ed3527532
https://github.com/barnowl/barnowl/commit/901cee9b7ebc203aee860a9c5fc3849ed3527532
Author: Jason Gross <jgross@mit.edu>
Date: 2011-07-03 (Sun, 03 Jul 2011)
Changed paths:
M commands.c
M messagelist.c
Log Message:
-----------
Don't segfault when you expunge all messages from the messagelist
When we used owl_list, trying to get an element from an empty list would
return NULL. When we moved to GPtrArray, we dropped this checking,
without dropping the assumption that, e.g.,
owl_view_get_element(v, owl_global_get_curmsg(&g));
works everywhere. This commit adds the logic back in to deal with this
case.
Additionally, don't segfault on things like :unpunt -1.