Skip to content

Commit 7093442

Browse files
author
Konstantin Gredeskoul
committed
Slight update to message text + handle NPE
1 parent f486e88 commit 7093442

File tree

1 file changed

+7
-3
lines changed
  • it.baeyens.arduino.common/src/it/baeyens/arduino/arduino

1 file changed

+7
-3
lines changed

it.baeyens.arduino.common/src/it/baeyens/arduino/arduino/Serial.java

+7-3
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,12 @@ public void connect() {
200200
}
201201
if (isMac && !haveVarLock) {
202202
Common.log(new Status(IStatus.ERROR, ArduinoConst.CORE_PLUGIN_ID, "Serial port " + PortName
203-
+ " not accessible: please run the following command: 'sudo mkdir -p /var/lock && sudo chmod 777 /var/lock'"));
203+
+ " is not accessible or already in use: try to quit all other programs that may be using it."
204+
+ " If that doesn't fix it, please run the following command:"
205+
+ "\n\nsudo mkdir -p /var/lock && sudo chmod 777 /var/lock\n"));
204206
} else {
205207
Common.log(new Status(IStatus.ERROR, ArduinoConst.CORE_PLUGIN_ID, "Serial port " + PortName
206-
+ " already in use. Try quiting any programs that may be using it", e));
208+
+ " already in use. Try to quit all other programs that may be using it.", e));
207209
}
208210
return;
209211
} catch (Exception e) {
@@ -245,7 +247,9 @@ public void disconnect() {
245247
}
246248

247249
public void dispose() {
248-
notifyConsumersOfEvent("Disconnect of port " + port.getName() + " executed");
250+
if (port != null)
251+
notifyConsumersOfEvent("Disconnect of port " + port.getName() + " executed");
252+
249253
disconnect();
250254

251255
if (fServiceRegistration != null) {

0 commit comments

Comments
 (0)