mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-30 19:52:13 +01:00
Fix randomic NPE when pressing menus during operations
This commit is contained in:
parent
52ef55380d
commit
ad74288e5a
@ -134,7 +134,11 @@ public abstract class Uploader implements MessageConsumer {
|
||||
if (!process.waitFor(2, TimeUnit.MINUTES)) {
|
||||
process.destroyForcibly();
|
||||
}
|
||||
result = process.exitValue();
|
||||
if (!process.isAlive()) {
|
||||
result = process.exitValue();
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -181,7 +181,7 @@ public class Platform {
|
||||
return list;
|
||||
}
|
||||
|
||||
public Map<String, Object> resolveDeviceByVendorIdProductId(String serial, Map<String, TargetPackage> packages) {
|
||||
public synchronized Map<String, Object> resolveDeviceByVendorIdProductId(String serial, Map<String, TargetPackage> packages) {
|
||||
String vid_pid_iSerial = resolveDeviceAttachedToNative(serial);
|
||||
for (TargetPackage targetPackage : packages.values()) {
|
||||
for (TargetPlatform targetPlatform : targetPackage.getPlatforms().values()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user