Avoid critical message

Gtk-CRITICAL **: gtk_notebook_get_n_pages: assertion 'GTK_IS_NOTEBOOK (notebook)' failed