Fix unreported: Copy-pasting nodes crashes when they have an undefined type
authorLukas Stockner <lukas.stockner@freenet.de>
Sun, 18 Jun 2017 03:13:32 +0000 (05:13 +0200)
committerLukas Stockner <lukas.stockner@freenet.de>
Sun, 18 Jun 2017 03:14:26 +0000 (05:14 +0200)
source/blender/editors/space_node/node_edit.c

index 9dc39b1839bfe3f9db5e7b563a56740b3f28257f..5f8f839025f4fb3e56cea798c68e1d99bf4ae064 100644 (file)
@@ -2086,7 +2086,7 @@ static int node_clipboard_paste_exec(bContext *C, wmOperator *op)
        /* make sure all clipboard nodes would be valid in the target tree */
        all_nodes_valid = true;
        for (node = clipboard_nodes_lb->first; node; node = node->next) {
-               if (!node->typeinfo->poll_instance(node, ntree)) {
+               if (!node->typeinfo->poll_instance || !node->typeinfo->poll_instance(node, ntree)) {
                        all_nodes_valid = false;
                        BKE_reportf(op->reports, RPT_ERROR, "Cannot add node %s into node tree %s", node->name, ntree->id.name + 2);
                }