mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2024-10-01 01:06:10 -04:00
main: qobject_cast may return null, check its result
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
This commit is contained in:
parent
a9d9d282d7
commit
19bfd7141d
@ -118,8 +118,10 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
QObject *rootObject = engine.rootObjects().first();
|
QObject *rootObject = engine.rootObjects().first();
|
||||||
QQuickWindow *windowObject = qobject_cast<QQuickWindow *>(rootObject);
|
QQuickWindow *windowObject = qobject_cast<QQuickWindow *>(rootObject);
|
||||||
QObject::connect(&app, &SingleApplication::receivedMessage,
|
Q_ASSERT(windowObject);
|
||||||
windowObject, [windowObject] () { raiseWindow(windowObject); } );
|
if (windowObject)
|
||||||
|
QObject::connect(&app, &SingleApplication::receivedMessage,
|
||||||
|
windowObject, [windowObject] () { raiseWindow(windowObject); } );
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
QDirIterator it("qrc:", QDirIterator::Subdirectories);
|
QDirIterator it("qrc:", QDirIterator::Subdirectories);
|
||||||
|
Loading…
Reference in New Issue
Block a user