Two bugfixes, reported by Sebastian Skejo in IRC:

- File operator poll wasn't secure, search for it crashed
- Knife tool depends on having view3d context, fixed poll for it
This commit is contained in:
Ton Roosendaal 2009-07-29 18:15:46 +00:00
parent 785bf413f3
commit da14738624
3 changed files with 8 additions and 6 deletions

@ -748,12 +748,14 @@ void ui_searchbox_autocomplete(bContext *C, ARegion *ar, uiBut *but, char *str)
{
uiSearchboxData *data= ar->regiondata;
data->items.autocpl= autocomplete_begin(str, ui_get_but_string_max_length(but));
if(str[0]) {
data->items.autocpl= autocomplete_begin(str, ui_get_but_string_max_length(but));
but->search_func(C, but->search_arg, but->editstr, &data->items);
but->search_func(C, but->search_arg, but->editstr, &data->items);
autocomplete_end(data->items.autocpl, str);
data->items.autocpl= NULL;
autocomplete_end(data->items.autocpl, str);
data->items.autocpl= NULL;
}
}
static void ui_searchbox_region_draw(const bContext *C, ARegion *ar)

@ -723,7 +723,7 @@ void MESH_OT_knife_cut(wmOperatorType *ot)
ot->modal= WM_gesture_lines_modal;
ot->exec= knife_cut_exec;
ot->poll= ED_operator_editmesh;
ot->poll= EM_view3d_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;

@ -933,7 +933,7 @@ int file_delete_poll(bContext *C)
SpaceFile *sfile= CTX_wm_space_file(C);
struct direntry* file;
if (sfile->params) {
if (sfile && sfile->params) {
if (sfile->params->active_file < 0) {
poll= 0;
} else {