[gnote] Fix crash when DESKTOP_SESSION environment variable is not set
- From: Aurimas Černius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] Fix crash when DESKTOP_SESSION environment variable is not set
- Date: Mon, 6 Jul 2015 19:18:42 +0000 (UTC)
commit 4152b10749cd6389e6523bc66b770dcb1c7a4d98
Author: Aurimas Černius <aurisc4 gmail com>
Date: Mon Jul 6 21:13:13 2015 +0300
Fix crash when DESKTOP_SESSION environment variable is not set
Fixes Bug 752024.
src/mainwindow.cpp | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index d7808db..32b5298 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -117,9 +117,11 @@ bool MainWindow::use_client_side_decorations()
std::vector<std::string> desktops;
sharp::string_split(desktops, setting, ",");
const char *current_desktop = std::getenv("DESKTOP_SESSION");
- FOREACH(std::string de, desktops) {
- if(de == current_desktop) {
- s_use_client_side_decorations = 1;
+ if (current_desktop) {
+ FOREACH(std::string de, desktops) {
+ if(de == current_desktop) {
+ s_use_client_side_decorations = 1;
+ }
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]