summaryrefslogtreecommitdiffstats
path: root/src/server
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-12-08 20:29:06 +0100
committerDavid Robillard <d@drobilla.net>2019-12-08 21:08:39 +0100
commit39dbbeccf55f953f975f61888dccfb2d14382f79 (patch)
tree22af40299a91392e1d35a3387a5f07b238646810 /src/server
parent69969efdecf3094b04d5700a016cddb7aea77133 (diff)
downloadingen-39dbbeccf55f953f975f61888dccfb2d14382f79.tar.gz
ingen-39dbbeccf55f953f975f61888dccfb2d14382f79.tar.bz2
ingen-39dbbeccf55f953f975f61888dccfb2d14382f79.zip
Cleanup: Fix potential null dereferences
Diffstat (limited to 'src/server')
-rw-r--r--src/server/events/Delta.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/server/events/Delta.cpp b/src/server/events/Delta.cpp
index 3fb60bfe..0a7b05ea 100644
--- a/src/server/events/Delta.cpp
+++ b/src/server/events/Delta.cpp
@@ -525,15 +525,18 @@ Delta::execute(RunContext& context)
}
break;
case SpecialType::POLYPHONIC: {
- GraphImpl* parent = reinterpret_cast<GraphImpl*>(object->parent());
- if (value.get<int32_t>()) {
- object->apply_poly(context, parent->internal_poly_process());
- } else {
- object->apply_poly(context, 1);
+ if (object) {
+ if (value.get<int32_t>()) {
+ auto* parent = reinterpret_cast<GraphImpl*>(object->parent());
+ object->apply_poly(context, parent->internal_poly_process());
+ } else {
+ object->apply_poly(context, 1);
+ }
}
} break;
case SpecialType::POLYPHONY:
- if (!_graph->apply_internal_poly(context,
+ if (_graph &&
+ !_graph->apply_internal_poly(context,
*_engine.buffer_factory(),
*_engine.maid(),
value.get<int32_t>())) {
@@ -557,7 +560,9 @@ Delta::execute(RunContext& context)
}
break;
case SpecialType::PRESET:
- block->set_enabled(false);
+ if (block) {
+ block->set_enabled(false);
+ }
break;
case SpecialType::NONE:
if (port) {