Skip to content

Commit 5c180c4

Browse files
committed
Startup issue with the scope in relationship to capturing open serials
1 parent 7e7f407 commit 5c180c4

File tree

1 file changed

+5
-3
lines changed
  • it.baeyens.arduino.monitor/src/it/baeyens/arduino/monitor/views

1 file changed

+5
-3
lines changed

it.baeyens.arduino.monitor/src/it/baeyens/arduino/monitor/views/ScopeView.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,11 @@ private void registerSerialService(ServiceEvent event) {
247247
*/
248248
private void registerExistingSerialService() {
249249
final ServiceReference<?> reference = Activator.context.getServiceReference(Serial.class.getName());
250-
final Object service = FrameworkUtil.getBundle(getClass()).getBundleContext().getService(reference);
251-
if (service instanceof Serial) {
252-
registerSerialService((Serial) service);
250+
if (reference != null) {
251+
final Object service = FrameworkUtil.getBundle(getClass()).getBundleContext().getService(reference);
252+
if (service instanceof Serial) {
253+
registerSerialService((Serial) service);
254+
}
253255
}
254256
}
255257

0 commit comments

Comments
 (0)