Fix crash using ID remapping on invalid ID pairs

Missing NULL checks caused crash in BKE_reportf formatting.
This commit is contained in:
Julian Eisel 2016-07-22 17:13:23 +02:00
parent 9c63878085
commit 7ca4cf2be5
1 changed files with 2 additions and 2 deletions

View File

@ -417,9 +417,9 @@ static int outliner_id_remap_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
if (!(old_id && (old_id != new_id) && (GS(old_id->name) == GS(new_id->name)))) {
if (!(old_id && new_id && (old_id != new_id) && (GS(old_id->name) == GS(new_id->name)))) {
BKE_reportf(op->reports, RPT_ERROR_INVALID_INPUT, "Invalid old/new ID pair ('%s' / '%s')",
old_id->name, new_id->name);
old_id ? old_id->name : "Invalid ID", new_id ? new_id->name : "Invalid ID");
return OPERATOR_CANCELLED;
}