From da550fb534ac3ff929575596910f9b770d74f561 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Thu, 19 May 2016 01:53:30 +0100 Subject: [PATCH] Fix null pointer dereference. --- src/core/operationstack.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/core/operationstack.cpp b/src/core/operationstack.cpp index 18ff942..32fc330 100644 --- a/src/core/operationstack.cpp +++ b/src/core/operationstack.cpp @@ -460,10 +460,13 @@ bool OperationStack::contains(const Partition* p) const foreach(Operation * o, operations()) { if (o->targets(*p)) return true; + CopyOperation* copyOp = dynamic_cast(o); - const Partition* source = ©Op->sourcePartition(); - if (source == p) - return true; + if (copyOp) { + const Partition* source = ©Op->sourcePartition(); + if (source == p) + return true; + } } return false;