mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +08:00
Detect emulated driver before casting to avoid crashs
This commit is contained in:
@@ -138,7 +138,8 @@ namespace BlackSimPlugin
|
||||
const CSimulatorPluginInfo plugin = sGui->getIContextSimulator()->getSimulatorPluginInfo();
|
||||
if (plugin.isEmulatedPlugin()) { return nullptr; } // cast would fail
|
||||
|
||||
ISimulator *simulator = sGui->getISimulator();
|
||||
ISimulator *simulator = sGui->getISimulator().data();
|
||||
if (!simulator || simulator->isEmulatedDriver()) { return nullptr; }
|
||||
if (!simulator->getSimulatorInfo().isFsxP3DFamily()) { return nullptr; }
|
||||
if (simulator->getSimulatorInfo() != m_simulator) { return nullptr; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user