summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ui/qt/remote_capture_dialog.cpp2
-rw-r--r--ui/recent.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/ui/qt/remote_capture_dialog.cpp b/ui/qt/remote_capture_dialog.cpp
index 81cd455183..98cc35ed10 100644
--- a/ui/qt/remote_capture_dialog.cpp
+++ b/ui/qt/remote_capture_dialog.cpp
@@ -84,7 +84,7 @@ void RemoteCaptureDialog::fillComboBox()
{
GHashTable *ht = get_remote_host_list();
ui->hostCombo->addItem(QString(""));
- if (g_hash_table_size(ht) > 0) {
+ if (recent_get_remote_host_list_size() > 0) {
g_hash_table_foreach(ht, fillBox, ui->hostCombo);
ui->hostCombo->insertSeparator(g_hash_table_size(ht)+1);
ui->hostCombo->addItem(QString(tr("Clear list")));
diff --git a/ui/recent.c b/ui/recent.c
index b95ee65eb6..01204f5d72 100644
--- a/ui/recent.c
+++ b/ui/recent.c
@@ -384,6 +384,10 @@ static GHashTable *remote_host_list=NULL;
int recent_get_remote_host_list_size(void)
{
+ if (remote_host_list == NULL) {
+ /* No entries exist. */
+ return 0;
+ }
return g_hash_table_size (remote_host_list);
}