mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 15:45:46 +08:00
Detect emulated driver before casting to avoid crashs
This commit is contained in:
@@ -854,9 +854,9 @@ namespace BlackCore
|
||||
return false;
|
||||
}
|
||||
|
||||
ISimulator *CContextSimulator::simulator() const
|
||||
QPointer<ISimulator> CContextSimulator::simulator() const
|
||||
{
|
||||
if (!this->isSimulatorAvailable()) { return nullptr; }
|
||||
if (!this->isSimulatorAvailable() || !m_simulatorPlugin.second) { return nullptr; }
|
||||
return m_simulatorPlugin.second;
|
||||
}
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ namespace BlackCore
|
||||
void gracefulShutdown();
|
||||
|
||||
//! Access to simulator (i.e. the plugin)
|
||||
ISimulator *simulator() const;
|
||||
QPointer<ISimulator> simulator() const;
|
||||
|
||||
//! Simulator available?
|
||||
bool hasSimulator() const { return this->simulator(); }
|
||||
|
||||
Reference in New Issue
Block a user