diff --git a/commands/command_edit.cpp b/commands/command_edit.cpp index 51967a405..7fbbc927c 100644 --- a/commands/command_edit.cpp +++ b/commands/command_edit.cpp @@ -1362,9 +1362,8 @@ void EditCylinder::undo() } EditSensors::EditSensors(int toCylinderIn, int fromCylinderIn) - : d(current_dive), toCylinder(toCylinderIn), fromCylinder(fromCylinderIn) + : d(current_dive), dc(get_dive_dc(d, dc_number)), toCylinder(toCylinderIn), fromCylinder(fromCylinderIn) { - const struct divecomputer *dc = get_dive_dc(d, dc_number); if (!d || !dc) return; diff --git a/commands/command_edit.h b/commands/command_edit.h index 32f053754..3015e08ad 100644 --- a/commands/command_edit.h +++ b/commands/command_edit.h @@ -446,8 +446,8 @@ public: EditSensors(int cylIndex, int fromCylinder); private: - struct divecomputer *dc; struct dive *d; + struct divecomputer *dc; int toCylinder; int fromCylinder; void mapSensors(int toCyl, int fromCyl);