File only-use-foreground-process-info-if-valid.patch of Package konsole.6356

From 40b1f0e851c115e1a2df79e7ec4bc4fe726d9e43 Mon Sep 17 00:00:00 2001
From: "Martin T. H. Sandsmark" <martin.sandsmark@kde.org>
Date: Sun, 20 Nov 2016 14:36:38 +0100
Subject: Only use foreground process info if valid

getProcessInfo() returned _foregroundProcessInfo without checking the
return value of updateForegroundProcessInfo() indicating whether
_foregroundProcessInfo was non-existent or invalid.

I think this might be the solution to a bunch of recent crash bugs,
but not closing them as I can't test.

Also skipping RB because it is a simple patch and RB is down from here.

CCBUG: 372401
CCBUG: 372620
CCBUG: 372619
CCBUG: 372593
---
 src/Session.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/Session.cpp b/src/Session.cpp
index 3269550..d63c8a0 100644
--- a/src/Session.cpp
+++ b/src/Session.cpp
@@ -961,8 +961,7 @@ ProcessInfo* Session::getProcessInfo()
 {
     ProcessInfo* process = 0;
 
-    if (isForegroundProcessActive()) {
-        updateForegroundProcessInfo();
+    if (isForegroundProcessActive() && updateForegroundProcessInfo()) {
         process = _foregroundProcessInfo;
     } else {
         updateSessionProcessInfo();
-- 
cgit v0.11.2

openSUSE Build Service is sponsored by