Bug 1579492 - Check if nullptr in DarwinGamepadService::ReportChangedCallback(). r=baku

Differential Revision: https://phabricator.services.mozilla.com/D45135

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Daosheng Mu 2019-09-09 11:58:01 +00:00
Родитель 66ec96da37
Коммит a7ca387905
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -339,7 +339,7 @@ void DarwinGamepadService::DeviceRemoved(IOHIDDeviceRef device) {
void DarwinGamepadService::ReportChangedCallback(
void* context, IOReturn result, void* sender, IOHIDReportType report_type,
uint32_t report_id, uint8_t* report, CFIndex report_length) {
if (report_type == kIOHIDReportTypeInput) {
if (context && report_type == kIOHIDReportTypeInput) {
reinterpret_cast<Gamepad*>(context)->ReportChanged(report, report_length);
}
}