fix crash if desktopRequestPipe is not available

This commit is contained in:
nakst 2022-01-16 10:36:50 +00:00
parent f224b596f0
commit 8ca087f804
1 changed files with 7 additions and 5 deletions
desktop

View File

@ -1590,11 +1590,13 @@ extern "C" void _start(EsProcessStartupInformation *_startupInformation) {
EsHeapFree(_data);
uint8_t m = DESKTOP_MSG_SYSTEM_CONFIGURATION_GET;
EsBuffer responseBuffer = { .canGrow = true };
MessageDesktop(&m, 1, ES_INVALID_HANDLE, &responseBuffer);
SystemConfigurationLoad((char *) responseBuffer.out, responseBuffer.bytes);
EsHeapFree(responseBuffer.out);
if (api.desktopRequestPipe) {
uint8_t m = DESKTOP_MSG_SYSTEM_CONFIGURATION_GET;
EsBuffer responseBuffer = { .canGrow = true };
MessageDesktop(&m, 1, ES_INVALID_HANDLE, &responseBuffer);
SystemConfigurationLoad((char *) responseBuffer.out, responseBuffer.bytes);
EsHeapFree(responseBuffer.out);
}
((void (*)()) api.startupInformation->applicationStartAddress)();
}