mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 03:53:24 +00:00
QML UI: don't crash when committing changes and unable to find the dive
This mainly happens because add dive is completely broken right now, but in general it seems to be good policy not to blindly dereference this pointer... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
ce2b910cdb
commit
dce3869339
1 changed files with 6 additions and 0 deletions
|
@ -279,6 +279,12 @@ void QMLManager::loadDivesWithValidCredentials()
|
|||
void QMLManager::commitChanges(QString diveId, QString suit, QString buddy, QString diveMaster, QString notes)
|
||||
{
|
||||
struct dive *d = get_dive_by_uniq_id(diveId.toInt());
|
||||
qDebug() << diveId.toInt() << (d != 0 ? d->number : -1);
|
||||
|
||||
if (!d) {
|
||||
qDebug() << "don't touch this... no dive";
|
||||
return;
|
||||
}
|
||||
bool diveChanged = false;
|
||||
|
||||
if (!same_string(d->suit, suit.toUtf8().data())) {
|
||||
|
|
Loading…
Add table
Reference in a new issue