From 09b00823dbc59b639db37315043afc385786cb07 Mon Sep 17 00:00:00 2001 From: Jaidyn Ann Date: Mon, 11 Oct 2021 12:42:13 -0500 Subject: [PATCH] Fix crash on first startup of Daemon (?) --- src/App.cpp | 1 - src/App.h | 1 - src/FeedsView.cpp | 1 - src/MainWindow.cpp | 1 - src/Notifier.cpp | 10 +++++++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/App.cpp b/src/App.cpp index 4b29ee2..e1e414f 100644 --- a/src/App.cpp +++ b/src/App.cpp @@ -17,7 +17,6 @@ #include "FeedsView.h" #include "MainWindow.h" #include "Mimetypes.h" -#include "Notifier.h" #include "Preferences.h" #include "SourceManager.h" #include "Util.h" diff --git a/src/App.h b/src/App.h index f18d787..430d589 100644 --- a/src/App.h +++ b/src/App.h @@ -13,7 +13,6 @@ class BMessage; class BMessageRunner; class FeedController; class MainWindow; -class Notifier; class App : public BApplication diff --git a/src/FeedsView.cpp b/src/FeedsView.cpp index 57d53b5..a62a2ba 100644 --- a/src/FeedsView.cpp +++ b/src/FeedsView.cpp @@ -22,7 +22,6 @@ #include "FeedEditWindow.h" #include "FeedListItem.h" #include "FeedListView.h" -#include "Notifier.h" #include "SourceListItem.h" #include "SourceManager.h" diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 7820689..c720b86 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -19,7 +19,6 @@ #include "FeedController.h" #include "FeedListView.h" #include "FeedsView.h" -#include "Notifier.h" #include "UpdatesView.h" diff --git a/src/Notifier.cpp b/src/Notifier.cpp index 9339136..2db1410 100644 --- a/src/Notifier.cpp +++ b/src/Notifier.cpp @@ -11,8 +11,9 @@ #include #include -#include "App.h" +#include "Daemon.h" #include "FeedController.h" +#include "Preferences.h" #undef B_TRANSLATION_CONTEXT @@ -128,8 +129,11 @@ Notifier::_SendUpdatedNotification() notifyNew.SetContent(notifyText); entry_ref feedsRef; - BEntry(((App*)be_app)->fPreferences->EntryDir()).GetRef(&feedsRef); - notifyNew.SetOnClickFile(&feedsRef); + const char* entryDir = ((App*)be_app)->fPreferences->EntryDir(); + if (entryDir != NULL) { + BEntry(entryDir).GetRef(&feedsRef); + notifyNew.SetOnClickFile(&feedsRef); + } notifyNew.Send(); }