Skip to content

Commit

Permalink
Allow waitForSerialEvent() to throw any kind of exception
Browse files Browse the repository at this point in the history
  • Loading branch information
hedgecrw committed Sep 3, 2019
1 parent 04d1bb2 commit e807406
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/com/fazecast/jSerialComm/SerialPort.java
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,7 @@ public void run()
while (isListening && isOpened)
{
try { waitForSerialEvent(); }
catch (NullPointerException e)
catch (Exception e)
{
isListening = false;
if (userDataListener instanceof SerialPortDataListenerWithExceptions)
Expand All @@ -1267,12 +1267,12 @@ public final void stopListening()
int oldEventFlags = eventFlags;
eventFlags = 0;
configEventFlags(portHandle);
eventFlags = oldEventFlags;
try { serialEventThread.join(); } catch (InterruptedException e) {}
serialEventThread = null;
eventFlags = oldEventFlags;
}

public final void waitForSerialEvent() throws NullPointerException
public final void waitForSerialEvent() throws Exception
{
switch (waitForEvent(portHandle))
{
Expand Down

0 comments on commit e807406

Please sign in to comment.