about summary refs log tree commit diff
path: root/pkgs/applications/kde
diff options
context:
space:
mode:
authorJos van den Oever <jos@vandenoever.info>2017-04-18 09:40:22 +0200
committerThomas Tuegel <ttuegel@mailbox.org>2017-08-21 06:51:14 -0500
commit828124b4201483bcbf84216ea2d32636eac645c9 (patch)
treeaf2ee6b079f83cd08ad3c1f49f741d166eb31a78 /pkgs/applications/kde
parentfa8d2401880c6b8185891005a9ea9b99dafaaef8 (diff)
downloadnixlib-828124b4201483bcbf84216ea2d32636eac645c9.tar
nixlib-828124b4201483bcbf84216ea2d32636eac645c9.tar.gz
nixlib-828124b4201483bcbf84216ea2d32636eac645c9.tar.bz2
nixlib-828124b4201483bcbf84216ea2d32636eac645c9.tar.lz
nixlib-828124b4201483bcbf84216ea2d32636eac645c9.tar.xz
nixlib-828124b4201483bcbf84216ea2d32636eac645c9.tar.zst
nixlib-828124b4201483bcbf84216ea2d32636eac645c9.zip
grantleetheme: check for a null pointer
Diffstat (limited to 'pkgs/applications/kde')
-rw-r--r--pkgs/applications/kde/grantleetheme.nix4
-rw-r--r--pkgs/applications/kde/grantleetheme_check_null.patch25
2 files changed, 28 insertions, 1 deletions
diff --git a/pkgs/applications/kde/grantleetheme.nix b/pkgs/applications/kde/grantleetheme.nix
index 9555e153a301..976ccbe28ce6 100644
--- a/pkgs/applications/kde/grantleetheme.nix
+++ b/pkgs/applications/kde/grantleetheme.nix
@@ -10,9 +10,11 @@ mkDerivation {
     license = with lib.licenses; [ gpl2 lgpl21 fdl12 ];
     maintainers = kdepimTeam;
   };
+  output = [ "out" "dev" ];
+  patches = [ ./grantleetheme_check_null.patch ];
   nativeBuildInputs = [ extra-cmake-modules kdoctools ];
   buildInputs = [
     grantlee5 ki18n kiconthemes knewstuff kservice kxmlgui qtbase
   ];
-  output = [ "out" "dev" ];
+  propagatedBuildInputs = [ grantlee5 kiconthemes knewstuff ];
 }
diff --git a/pkgs/applications/kde/grantleetheme_check_null.patch b/pkgs/applications/kde/grantleetheme_check_null.patch
new file mode 100644
index 000000000000..730d5b0fe261
--- /dev/null
+++ b/pkgs/applications/kde/grantleetheme_check_null.patch
@@ -0,0 +1,25 @@
+diff --git a/src/grantleetheme.cpp b/src/grantleetheme.cpp
+index b86fc3a..8af72f4 100644
+--- a/src/grantleetheme.cpp
++++ b/src/grantleetheme.cpp
+@@ -102,7 +102,10 @@ QString ThemePrivate::errorTemplate(const QString &reason,
+     Grantlee::Context ctx = createContext();
+     ctx.insert(QStringLiteral("error"), reason);
+     ctx.insert(QStringLiteral("templateName"), origTemplateName);
+-    ctx.insert(QStringLiteral("errorMessage"), failedTemplate->errorString());
++    const QString errorString = failedTemplate
++            ? failedTemplate->errorString()
++            : QStringLiteral("(null template)");
++    ctx.insert(QStringLiteral("errorMessage"), errorString);
+     return tpl->render(&ctx);
+ }
+ 
+@@ -208,7 +211,7 @@ QString Theme::render(const QString &templateName, const QVariantHash &data, con
+     }
+ 
+     Grantlee::Template tpl = d->loader->loadByName(templateName, ThemePrivate::sEngine);
+-    if (tpl->error()) {
++    if (!tpl || tpl->error()) {
+         return d->errorTemplate(i18n("Template parsing error"), templateName, tpl);
+     }
+