I'd also change the second part of the patch to be clearer, i.e.
if (gtk_tree_model_iter_n_children (model, NULL) == 0) gtk_widget_set_sensitive (dialog->input_bar, FALSE);
The first part of the patch is a workaround for a bug elsewhere which is reporting things in the wrong order. The second part is a fix for a case that wasn't being handled correctly. So both seem correct to me.
I'd also change the second part of the patch to be clearer, i.e.
if (gtk_tree_ model_iter_ n_children (model, NULL) == 0)
gtk_widget_ set_sensitive (dialog->input_bar, FALSE);
The first part of the patch is a workaround for a bug elsewhere which is reporting things in the wrong order. The second part is a fix for a case that wasn't being handled correctly. So both seem correct to me.