Modbus server: fix data conversion error handling
In line
ok = modbusDevice->setData(..., value.toUShort(&ok, 16));
the value of 'ok' variable after the toUShort() conversion is
immediately overwritten by the return value of setData() method.
As a result, the code could never detect that toUShort() conversion
failed.
This commit splits the line into several independent statements, adding
an if (ok) check in between.
Task-number: QTBUG-110890
Pick-to: 6.5
Change-Id: I98a9275262f5a05fee77905ce7c7d861f2dce6fe
Reviewed-by: André Hartmann <aha_1980@gmx.de>