Allow window == NULL.

master
Yevgen Muntyan 2006-04-08 03:45:22 -05:00
parent ff8ef23036
commit 8dc62a9365
1 changed files with 3 additions and 2 deletions

View File

@ -144,10 +144,11 @@ moo_edit_context_set_doc (MooEditContext *ctx,
MSContext *
moo_edit_context_new (MooEditWindow *window)
{
g_return_val_if_fail (MOO_IS_EDIT_WINDOW (window), NULL);
g_return_val_if_fail (!window || MOO_IS_EDIT_WINDOW (window), NULL);
return g_object_new (MOO_TYPE_EDIT_CONTEXT,
"window", window,
"doc", moo_edit_window_get_active_doc (window),
"doc", window ? moo_edit_window_get_active_doc (window) : NULL,
NULL);
}