mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
new_messenger(options ... ) must never be null
This commit is contained in:
parent
404042cc2d
commit
8822f595a8
|
@ -1887,6 +1887,10 @@ static int friend_already_added(const uint8_t *real_pk, void *data)
|
|||
/* Run this at startup. */
|
||||
Messenger *new_messenger(Messenger_Options *options, unsigned int *error)
|
||||
{
|
||||
if (!options) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Messenger *m = (Messenger *)calloc(1, sizeof(Messenger));
|
||||
|
||||
if (error) {
|
||||
|
@ -1899,7 +1903,7 @@ Messenger *new_messenger(Messenger_Options *options, unsigned int *error)
|
|||
|
||||
Logger *log = NULL;
|
||||
|
||||
if (options && options->log_callback) {
|
||||
if (options->log_callback) {
|
||||
log = logger_new();
|
||||
|
||||
if (log != NULL) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user