summaryrefslogtreecommitdiff
path: root/ticket.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'ticket.cxx')
-rw-r--r--ticket.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/ticket.cxx b/ticket.cxx
index 026a23d..cd984c5 100644
--- a/ticket.cxx
+++ b/ticket.cxx
@@ -42,9 +42,11 @@ namespace RTClient {
void TicketList::update(rtclient_ticketlist* ticketList)
{
- for (size_t i = 0; i < ticketList->length; i++)
- addTicket(Ticket{ticketList->tickets[i]});
- rtclient_ticket_freelist(ticketList);
+ if (ticketList) {
+ for (size_t i = 0; i < ticketList->length; i++)
+ addTicket(Ticket{ticketList->tickets[i]});
+ rtclient_ticket_freelist(ticketList);
+ }
emit updated();
}