1
0
mirror of git://projects.qi-hardware.com/fped.git synced 2024-12-23 04:43:21 +02:00

- gui.c (change_world_reselect): take into account that we may get called

with a selected object but no selected instance. In this case, don't try to
  re-select. (Not perfect, but better than the crash this caused so far.)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5999 99fdad57-331a-0410-800a-d7fa5415bdb3
This commit is contained in:
werner 2011-01-22 00:54:56 +00:00
parent 49a1bbdd05
commit 1409cfafd8

11
gui.c
View File

@ -342,6 +342,17 @@ void change_world_reselect(void)
{ {
struct obj *selected_obj; struct obj *selected_obj;
/*
* We can edit an object even if it's not selected if it was picked
* via the item view. inst_select_obj tries to find an instance, but
* if there's never been a successful instantiation since creation of
* the object or if the object is unreachable for some other reason,
* then selected_inst will be NULL.
*/
if (!selected_inst) {
change_world();
return;
}
selected_obj = selected_inst->obj; selected_obj = selected_inst->obj;
change_world(); change_world();
inst_select_obj(selected_obj); inst_select_obj(selected_obj);