mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-30 19:52:13 +01:00
Compiler: fixed wrong check against non existent folder and a possible NPE
This commit is contained in:
parent
e097439eab
commit
a853372872
@ -359,7 +359,7 @@ public class Compiler implements MessageConsumer {
|
||||
*/
|
||||
public boolean compile(boolean _verbose, boolean _save) throws RunnerException, PreferencesMapException {
|
||||
File sketchBuildFolder = new File(prefs.get("build.path"), "sketch");
|
||||
if (!sketchBuildFolder.mkdirs()) {
|
||||
if (!sketchBuildFolder.exists() && !sketchBuildFolder.mkdirs()) {
|
||||
throw new RunnerException("Unable to create folder " + sketchBuildFolder);
|
||||
}
|
||||
preprocess(sketchBuildFolder.getAbsolutePath());
|
||||
@ -489,6 +489,9 @@ public class Compiler implements MessageConsumer {
|
||||
}
|
||||
|
||||
private void adviseDuplicateLibraries() {
|
||||
if (importedDuplicateHeaders == null) {
|
||||
return;
|
||||
}
|
||||
for (int i=0; i < importedDuplicateHeaders.size(); i++) {
|
||||
System.out.println(I18n.format(_("Multiple libraries were found for \"{0}\""),
|
||||
importedDuplicateHeaders.get(i)));
|
||||
|
Loading…
x
Reference in New Issue
Block a user