mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-18 16:32:16 -07:00
Reintroduce null check.
This commit is contained in:
parent
1237d9b480
commit
d8ea31e2cc
1 changed files with 4 additions and 0 deletions
|
|
@ -67,6 +67,10 @@ QList<DeckPreviewWidget *> &VisualDeckStorageSortWidget::filterFiles(QList<DeckP
|
||||||
{
|
{
|
||||||
// Sort the widgets list based on the current sort order
|
// Sort the widgets list based on the current sort order
|
||||||
std::sort(widgets.begin(), widgets.end(), [this](DeckPreviewWidget *widget1, DeckPreviewWidget *widget2) {
|
std::sort(widgets.begin(), widgets.end(), [this](DeckPreviewWidget *widget1, DeckPreviewWidget *widget2) {
|
||||||
|
if (!widget1 || !widget2) {
|
||||||
|
return false; // Handle null pointers gracefully
|
||||||
|
}
|
||||||
|
|
||||||
QFileInfo info1(widget1->filePath);
|
QFileInfo info1(widget1->filePath);
|
||||||
QFileInfo info2(widget2->filePath);
|
QFileInfo info2(widget2->filePath);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue