diff --git a/cmds/incidentd/src/IncidentService.cpp b/cmds/incidentd/src/IncidentService.cpp index 5af02f405ed9c..c2f010097fdad 100644 --- a/cmds/incidentd/src/IncidentService.cpp +++ b/cmds/incidentd/src/IncidentService.cpp @@ -513,6 +513,9 @@ status_t IncidentService::onTransact(uint32_t code, const Parcel& data, Parcel* sp shellCallback = IShellCallback::asInterface(data.readStrongBinder()); sp resultReceiver = IResultReceiver::asInterface(data.readStrongBinder()); + if (resultReceiver == nullptr) { + return BAD_VALUE; + } FILE* fin = fdopen(in, "r"); FILE* fout = fdopen(out, "w");