Fixes Gee hard assertion due to FETCH error: Closes #4392
Not doing proper bounds checking with ListParameter.get methods.
This commit is contained in:
parent
0a19cb925d
commit
bd65c786cd
1 changed files with 4 additions and 1 deletions
|
|
@ -153,10 +153,13 @@ public class Geary.Imap.ListParameter : Geary.Imap.Parameter {
|
|||
}
|
||||
|
||||
public new Parameter? get(int index) {
|
||||
return list.get(index);
|
||||
return (index < list.size) ? list.get(index) : null;
|
||||
}
|
||||
|
||||
public Parameter get_required(int index) throws ImapError {
|
||||
if (index >= list.size)
|
||||
throw new ImapError.TYPE_ERROR("No parameter at index %d", index);
|
||||
|
||||
Parameter? param = list.get(index);
|
||||
if (param == null)
|
||||
throw new ImapError.TYPE_ERROR("No parameter at index %d", index);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue