diff --git a/src/SensorRunner.php b/src/SensorRunner.php
index cb09509..e0c9b92 100644
--- a/src/SensorRunner.php
+++ b/src/SensorRunner.php
@@ -185,9 +185,14 @@ class SensorRunner {
       $result->setExecutionTime($timer['time']);
 
       // Capture verbose output if requested and if we are able to do so.
-      if ($this->verbose && $sensor_config->isExtendedInfo()) {
-        /** @var \Drupal\monitoring\SensorPlugin\ExtendedInfoSensorPluginInterface $plugin */
-        $result->setVerboseOutput($plugin->resultVerbose($result));
+      try {
+        if ($this->verbose && $sensor_config->isExtendedInfo()) {
+          /** @var \Drupal\monitoring\SensorPlugin\ExtendedInfoSensorPluginInterface $plugin */
+          $result->setVerboseOutput($plugin->resultVerbose($result));
+        }
+      }
+      catch (\Exception $e) {
+        $result->setVerboseOutput(array('#markup' => $e->getMessage()));
       }
 
       try {
diff --git a/src/Tests/MonitoringCoreKernelTest.php b/src/Tests/MonitoringCoreKernelTest.php
index 0f9188b..c97175b 100644
--- a/src/Tests/MonitoringCoreKernelTest.php
+++ b/src/Tests/MonitoringCoreKernelTest.php
@@ -682,6 +682,23 @@ class MonitoringCoreKernelTest extends MonitoringUnitTestBase {
     $result = $this->runSensor('watchdog_aggregate_test');
     $this->assertTrue($result->isCritical());
     $this->assertEqual($result->getValue(), 3);
+
+    // Test database aggregator with invalid conditions.
+    $sensor = SensorConfig::create(array(
+      'id' => 'db_test',
+      'label' => 'Database sensor invalid',
+      'plugin_id' => 'database_aggregator',
+      'settings' => array(
+        'table' => 'watchdog',
+      ),
+    ));
+    $sensor->settings['conditions'] = array(
+      array('field' => 'invalid', 'value' => ''),
+    );
+    $sensor->settings['verbose_fields']['0'] = 'wid';
+    $sensor->save();
+    $result = $this->runSensor('db_test');
+    $this->assertTrue($result->isCritical());
   }
 
 }
