mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 21:21:32 +00:00
Do not dereference getFormat() if it is null
Return early when format is unknown. I am not sure whether this is supposed to happen and whether we should assert on this condition. Spotted by coverity.
This commit is contained in:
parent
48d164ddef
commit
c42776868d
@ -623,7 +623,10 @@ string const stripExtensionIfPossible(string const & file, string const & to, bo
|
||||
{
|
||||
// No conversion is needed. LaTeX can handle the graphic file as is.
|
||||
// This is true even if the orig_file is compressed.
|
||||
string const to_format = theFormats().getFormat(to)->extension();
|
||||
Format const * f = theFormats().getFormat(to);
|
||||
if (!f)
|
||||
return latex_path(file, EXCLUDE_EXTENSION);
|
||||
string const to_format = f->extension();
|
||||
string const file_format = getExtension(file);
|
||||
// for latex .ps == .eps
|
||||
if (to_format == file_format ||
|
||||
|
Loading…
Reference in New Issue
Block a user