From 7cc37bd444c68cc22b3395bf2dfeb8f65e768dd3 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Wed, 1 Jun 2022 14:03:54 +0200 Subject: [PATCH] okular: cast the part pointer via qobject_cast() in Shell::openDocument() fixes crash on startup on FreeBSD Signed-off-by: Ivailo Monev --- okular/shell/shell.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/okular/shell/shell.cpp b/okular/shell/shell.cpp index 16116f73..152b9e20 100644 --- a/okular/shell/shell.cpp +++ b/okular/shell/shell.cpp @@ -166,7 +166,7 @@ bool Shell::openDocument( const QString& url, const QString &serializedOptions ) KParts::ReadWritePart* const part = m_tabs[0].part; // Return false if we can't open new tabs and the only part is occupied - if ( !dynamic_cast(part)->openNewFilesInTabs() + if ( !qobject_cast(part)->openNewFilesInTabs() && !part->url().isEmpty() && !ShellUtils::unique(serializedOptions)) {