mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-27 19:59:46 +00:00
Fix potential null pointer detected by Coverity
This commit is contained in:
parent
5279f3e11f
commit
bc644d131c
@ -182,11 +182,14 @@ docstring InsetInfoParams::getDate(string const iname, QDate const date) const
|
|||||||
else if (iname == "ISO")
|
else if (iname == "ISO")
|
||||||
return qstring_to_ucs4(date.toString(Qt::ISODate));
|
return qstring_to_ucs4(date.toString(Qt::ISODate));
|
||||||
else if (iname == "loclong")
|
else if (iname == "loclong")
|
||||||
return qstring_to_ucs4(loc.toString(date, toqstr(lang->dateFormat(0))));
|
return lang ? qstring_to_ucs4(loc.toString(date, toqstr(lang->dateFormat(0))))
|
||||||
|
: _("No long date format (language unknown)!");
|
||||||
else if (iname == "locmedium")
|
else if (iname == "locmedium")
|
||||||
return qstring_to_ucs4(loc.toString(date, toqstr(lang->dateFormat(1))));
|
return lang ? qstring_to_ucs4(loc.toString(date, toqstr(lang->dateFormat(1))))
|
||||||
|
: _("No medium date format (language unknown)!");
|
||||||
else if (iname == "locshort")
|
else if (iname == "locshort")
|
||||||
return qstring_to_ucs4(loc.toString(date, toqstr(lang->dateFormat(2))));
|
return lang ? qstring_to_ucs4(loc.toString(date, toqstr(lang->dateFormat(2))))
|
||||||
|
: _("No short date format (language unknown)!");
|
||||||
else
|
else
|
||||||
return qstring_to_ucs4(loc.toString(date, toqstr(iname)));
|
return qstring_to_ucs4(loc.toString(date, toqstr(iname)));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user