mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-07 01:54:26 +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)) {
|
if (!process.waitFor(2, TimeUnit.MINUTES)) {
|
||||||
process.destroyForcibly();
|
process.destroyForcibly();
|
||||||
}
|
}
|
||||||
result = process.exitValue();
|
if (!process.isAlive()) {
|
||||||
|
result = process.exitValue();
|
||||||
|
} else {
|
||||||
|
result = 0;
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -181,7 +181,7 @@ public class Platform {
|
|||||||
return list;
|
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);
|
String vid_pid_iSerial = resolveDeviceAttachedToNative(serial);
|
||||||
for (TargetPackage targetPackage : packages.values()) {
|
for (TargetPackage targetPackage : packages.values()) {
|
||||||
for (TargetPlatform targetPlatform : targetPackage.getPlatforms().values()) {
|
for (TargetPlatform targetPlatform : targetPackage.getPlatforms().values()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user