diff --git a/server/src/plugin/plugin.c b/server/src/plugin/plugin.c index 5c3e972..8a52016 100644 --- a/server/src/plugin/plugin.c +++ b/server/src/plugin/plugin.c @@ -40,10 +40,11 @@ int pw3270_plugin_page_added(GtkWidget *terminal) { - // Creates IPC, associate it with the terminal window. + if(!GTK_IS_V3270(terminal)) + return EINVAL; - g_return_val_if_fail(GTK_IS_V3270(terminal),EINVAL); + // Creates IPC, associate it with the terminal window. // Build session name. g_autofree gchar * session_name = g_strdup(v3270_get_session_name(terminal)); { @@ -108,13 +109,13 @@ int pw3270_plugin_page_removed(GtkWidget *terminal) { - if(GTK_IS_V3270(terminal)) { - debug("%s(%p)",__FUNCTION__,g_object_get_data(G_OBJECT(terminal),"ipc-object-info")); - g_object_set_data(G_OBJECT(terminal), "ipc-object-info", NULL); - return 0; - } + if(!GTK_IS_V3270(terminal)) + return EINVAL; + + debug("%s(%p)",__FUNCTION__,g_object_get_data(G_OBJECT(terminal),"ipc-object-info")); + g_object_set_data(G_OBJECT(terminal), "ipc-object-info", NULL); + return 0; - return -1; } int pw3270_plugin_start(GtkWidget G_GNUC_UNUSED(*window), GtkWidget *terminal) { -- libgit2 0.21.2