Commit 81c08717 authored by Volker Krause's avatar Volker Krause
Browse files

Add safeguard against losing time values during editing

That is never intended and impossible to recover from without re-importing.
parent 2dd8110a
......@@ -41,6 +41,11 @@ QDateTime Util::dateTimeStripTimezone(const QVariant& obj, const QString& proper
QVariant Util::setDateTimePreserveTimezone(const QVariant &obj, const QString& propertyName, QDateTime value) const
{
if (!value.isValid()) {
qCDebug(Log) << "Invalid date passed for property" << propertyName;
return obj;
}
QVariant o(obj);
const auto oldDt = JsonLdDocument::readProperty(obj, propertyName.toUtf8().constData()).toDateTime();
if (oldDt.isValid()) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment