1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-12-23 03:13:25 +01:00

Check if pointer is null before accessing

This commit is contained in:
jfreegman 2018-10-28 07:09:37 -04:00
parent b7d67c1d86
commit 9e3d4f3889
No known key found for this signature in database
GPG Key ID: 3627F3144076AE63

View File

@ -54,7 +54,7 @@ void on_friend_request(Tox *m, const uint8_t *public_key, const uint8_t *data, s
length = copy_tox_str(msg, sizeof(msg), (const char *) data, length);
for (uint8_t i = 0; i < MAX_WINDOWS_NUM; ++i) {
if (windows[i]->onFriendRequest != NULL) {
if (windows[i] != NULL && windows[i]->onFriendRequest != NULL) {
windows[i]->onFriendRequest(windows[i], m, (const char *) public_key, msg, length);
}
}