Fix ide crash when empty build method is saved #1186

git-svn-id: svn://ultimatepp.org/upp/trunk@8687 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
klugier 2015-07-15 20:05:57 +00:00
parent 46a564dd84
commit 040b014f3d
2 changed files with 9 additions and 5 deletions

View file

@ -205,8 +205,9 @@ bool AndroidBuilder::BuildPackage(const String& package, Vector<String>& linkfil
for(int i = 0; i < pkg.flag.GetCount(); i++)
pkgMakeFile.AddCppFlag(pkg.flag[i].text);
for(int i = 0; i < pkg.library.GetCount(); i++)
pkgMakeFile.AddLdLibrary(pkg.library[i].text);
Vector<String> libs = Split(Gather(pkg.library, config.GetKeys()), ' ');
for(int i = 0; i < libs.GetCount(); i++)
pkgMakeFile.AddLdLibrary(libs[i]);
Vector<String> staticLibs = Split(Gather(pkg.static_library, config.GetKeys()), ' ');
for(int i = 0; i < staticLibs.GetCount(); i++)

View file

@ -445,7 +445,9 @@ void BuildMethods::Load()
VectorMap<String, String> map;
String fn = ConfigFile(ff.GetName());
if(LoadVarFile(fn, map)) {
String builderName = map.Get("BUILDER");
int builderIdx = map.Find("BUILDER");
String builderName = builderIdx >= 0 ? map[builderIdx] : "";
int setupIdx = -1;
String prefix;
for(int i = 0; i < setups.GetCount(); i++) {
@ -646,8 +648,9 @@ VectorMap<String, String> BuildMethods::MapBuilderVars(const VectorMap<String, S
{
VectorMap<String, String> mapedMap;
Index<String> varsToMaped;
String builder = map.Get("BUILDER");
int builderIdx = map.Find("BUILDER");
String builder = builderIdx >= 0 ? map[builderIdx] : "";
if(builder.IsEmpty())
return VectorMap<String, String>();