Sculptmode should check for existance of undo data before undo/redo in case user loads a file with sculptmode on and presses undo/redo before doing a sculpt action.

This commit is contained in:
Nicholas Bishop 2006-12-03 20:35:35 +00:00
parent d7aaa84dd9
commit dde6444d51

@ -432,7 +432,7 @@ void sculptmode_undo()
{
SculptUndo *su= G.scene->sculptdata.undo;
if(su->cur->prev)
if(su && su->cur->prev)
sculptmode_undo_update(su->cur->prev);
}
@ -440,7 +440,7 @@ void sculptmode_redo()
{
SculptUndo *su= G.scene->sculptdata.undo;
if(su->cur->next)
if(su && su->cur->next)
sculptmode_undo_update(su->cur->next);
}
@ -451,6 +451,8 @@ void sculptmode_undo_menu()
DynStr *ds= BLI_dynstr_new();
char *menu;
if(!su) return;
BLI_dynstr_append(ds, "Sculpt Mode Undo History %t");
for(sus= su->steps.first; sus; sus= sus->next) {
BLI_dynstr_append(ds, "|");