partitionmanager: avoid NULL dereference when no devices are found
ClosedPublic

Authored by rjvbb on Jun 9 2018, 9:26 AM.

Details

Summary

I ran into a crash which I traced to a nullptr dereference of a QMenu pointer in case no devices are found, for some reason.

I don't yet understand how the device scan fails but it should not lead to a crash. This patch implements a minimal fix.

Diff Detail

Repository
R17 Partition Manager
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
rjvbb requested review of this revision.Jun 9 2018, 9:26 AM
rjvbb created this revision.
stikonas accepted this revision.Jun 9 2018, 9:32 AM
stikonas added a subscriber: stikonas.

Looks good. Never ran into it but I haven't tested that much with 0 devices.

This revision is now accepted and ready to land.Jun 9 2018, 9:32 AM

By the way, what about void MainWindow::onSelectedDeviceMenuTriggered(bool). It has another call to container. Maybe add nullptr check there too?

This revision was automatically updated to reflect the committed changes.