[glom] Check some return values.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] Check some return values.
- Date: Thu, 4 Dec 2014 18:36:20 +0000 (UTC)
commit c51f2dbef33ae0a12b653edae24522c979db3663
Author: Murray Cumming <murrayc murrayc com>
Date: Thu Dec 4 19:32:31 2014 +0100
Check some return values.
Found by Coverity Scan.
glom/base_db.cc | 7 ++++++-
glom/mode_design/users/dialog_users_list.cc | 6 +++++-
2 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/glom/base_db.cc b/glom/base_db.cc
index 1cffa84..37577e6 100644
--- a/glom/base_db.cc
+++ b/glom/base_db.cc
@@ -266,9 +266,14 @@ sharedptr<Field> Base_DB::change_column(const Glib::ustring& table_name, const s
ConnectionPool* connection_pool = ConnectionPool::get_instance();
sharedptr<Field> result = check_field_change_constraints(field_old, field);
+ //TODO: change_column() doesn't throw any exception.
try
{
- connection_pool->change_column(table_name, field_old, result);
+ if(!connection_pool->change_column(table_name, field_old, result))
+ {
+ std::cerr << G_STRFUNC << ": change_column() failed." << std::endl;
+ return sharedptr<Field>();
+ }
}
catch(const Glib::Error& ex)
{
diff --git a/glom/mode_design/users/dialog_users_list.cc b/glom/mode_design/users/dialog_users_list.cc
index 6a2faed..8cf6d60 100644
--- a/glom/mode_design/users/dialog_users_list.cc
+++ b/glom/mode_design/users/dialog_users_list.cc
@@ -266,7 +266,11 @@ void Dialog_UsersList::on_button_user_new()
if(response != Gtk::RESPONSE_OK)
return;
- DbUtils::add_user(get_document(), user, password, m_combo_group->get_active_text() /* group */);
+ if(!DbUtils::add_user(get_document(), user, password, m_combo_group->get_active_text() /* group */))
+ {
+ std::cerr << G_STRFUNC << ": add_user() failed." << std::endl;
+ }
+
fill_list();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]