mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Fix Macro device data crash
If you attempt to download from a Macro device and use wrong device or initial read fails then it crashes, this patch fixes that. It does not fix more general data errors but should at least mean incorrect user selections do not result in GC crashing. Fixes #366.
This commit is contained in:
@@ -114,6 +114,13 @@ MacroDevice::download(CommPortPtr dev, const QDir &tmpdir,
|
||||
|
||||
MacroPacket response = MacroPacket();
|
||||
response.read(dev, 2, err);
|
||||
|
||||
if (response.payload.size() == 0)
|
||||
{
|
||||
err = "no data";
|
||||
return false;
|
||||
}
|
||||
|
||||
char count = response.payload.at(0);
|
||||
|
||||
if (count == 0)
|
||||
|
||||
Reference in New Issue
Block a user