[glom] Dialog_DatabasePreferences: Move a null check to earlier.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] Dialog_DatabasePreferences: Move a null check to earlier.
- Date: Wed, 3 Dec 2014 09:21:30 +0000 (UTC)
commit 91e61d88153e35761ad80fc13086516eca0f3dd0
Author: Murray Cumming <murrayc murrayc com>
Date: Wed Dec 3 10:21:05 2014 +0100
Dialog_DatabasePreferences: Move a null check to earlier.
Found by Coverity Scan.
glom/mode_design/dialog_database_preferences.cc | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/glom/mode_design/dialog_database_preferences.cc b/glom/mode_design/dialog_database_preferences.cc
index 71c03a8..842dba7 100644
--- a/glom/mode_design/dialog_database_preferences.cc
+++ b/glom/mode_design/dialog_database_preferences.cc
@@ -232,6 +232,8 @@ void Dialog_Database_Preferences::save_to_document()
m_system_prefs.m_org_logo = m_image->get_value();
Document* document = get_document();
+ if(!document)
+ return;
//Make sure that set_database_preferences() can work.
if(get_userlevel() == AppState::USERLEVEL_DEVELOPER)
@@ -241,8 +243,6 @@ void Dialog_Database_Preferences::save_to_document()
//The script is not part of "database preferences" in the database data,
//because it does not seem to be part of simple personalisation.
- if(!document)
- return;
const Glib::ustring script = m_text_view_script->get_buffer()->get_text();
document->set_startup_script(script);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]