Skip to content

Commit a4224ff

Browse files
committed
quick fix for serial
1 parent 210c155 commit a4224ff

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

Source/Device/Serial.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,16 @@ namespace Device
145145

146146
void SerialPort::Open(uint64_t handle)
147147
{
148-
if (handle < device_list.size())
148+
if (port.empty())
149149
{
150-
port = device_list[handle];
151-
}
152-
else
153-
{
154-
throw std::runtime_error("Serial: Invalid device handle " + std::to_string(handle));
150+
if (handle < device_list.size())
151+
{
152+
port = device_list[handle];
153+
}
154+
else
155+
{
156+
throw std::runtime_error("Serial: Invalid device handle " + std::to_string(handle));
157+
}
155158
}
156159
}
157160

0 commit comments

Comments
 (0)