Import project: Avoid NULL pointer dereference
This commit is contained in:
parent
e448cc68b5
commit
f7bff1a272
|
@ -196,15 +196,17 @@ ImportProject::Type ImportProject::import(const std::string &filename, Settings
|
||||||
if (!mPath.empty() && !endsWith(mPath,'/'))
|
if (!mPath.empty() && !endsWith(mPath,'/'))
|
||||||
mPath += '/';
|
mPath += '/';
|
||||||
|
|
||||||
|
const std::string fileFilter = settings ? settings->fileFilter : std::string();
|
||||||
|
|
||||||
if (endsWith(filename, ".json", 5)) {
|
if (endsWith(filename, ".json", 5)) {
|
||||||
importCompileCommands(fin);
|
importCompileCommands(fin);
|
||||||
return ImportProject::Type::COMPILE_DB;
|
return ImportProject::Type::COMPILE_DB;
|
||||||
} else if (endsWith(filename, ".sln", 4)) {
|
} else if (endsWith(filename, ".sln", 4)) {
|
||||||
importSln(fin, mPath, settings->fileFilter);
|
importSln(fin, mPath, fileFilter);
|
||||||
return ImportProject::Type::VS_SLN;
|
return ImportProject::Type::VS_SLN;
|
||||||
} else if (endsWith(filename, ".vcxproj", 8)) {
|
} else if (endsWith(filename, ".vcxproj", 8)) {
|
||||||
std::map<std::string, std::string, cppcheck::stricmp> variables;
|
std::map<std::string, std::string, cppcheck::stricmp> variables;
|
||||||
importVcxproj(filename, variables, emptyString, settings->fileFilter);
|
importVcxproj(filename, variables, emptyString, fileFilter);
|
||||||
return ImportProject::Type::VS_VCXPROJ;
|
return ImportProject::Type::VS_VCXPROJ;
|
||||||
} else if (endsWith(filename, ".bpr", 4)) {
|
} else if (endsWith(filename, ".bpr", 4)) {
|
||||||
importBcb6Prj(filename);
|
importBcb6Prj(filename);
|
||||||
|
|
Loading…
Reference in New Issue