Fix null pointer dereference.

This commit is contained in:
Andrius Štikonas 2016-05-19 01:53:30 +01:00
parent 349b59574f
commit da550fb534
1 changed files with 6 additions and 3 deletions

View File

@ -460,10 +460,13 @@ bool OperationStack::contains(const Partition* p) const
foreach(Operation * o, operations()) { foreach(Operation * o, operations()) {
if (o->targets(*p)) if (o->targets(*p))
return true; return true;
CopyOperation* copyOp = dynamic_cast<CopyOperation*>(o); CopyOperation* copyOp = dynamic_cast<CopyOperation*>(o);
const Partition* source = &copyOp->sourcePartition(); if (copyOp) {
if (source == p) const Partition* source = &copyOp->sourcePartition();
return true; if (source == p)
return true;
}
} }
return false; return false;