diff --git a/host/plugin-host.cc b/host/plugin-host.cc
index c954800..fb62e69 100644
--- a/host/plugin-host.cc
+++ b/host/plugin-host.cc
@@ -265,6 +265,12 @@ static clap_window makeClapWindow(WId window) {
 void PluginHost::setParentWindow(WId parentWindow) {
    checkForMainThread();
 
+    if(!_plugin)
+    {
+        std::cerr << "called with a null clap_plugin pointer!" << std::endl;
+        return;
+    }
+
    if (!_plugin->canUseGui())
       return;