From 2201382fa1e778e801b1db41f1588e0bd5710010 Mon Sep 17 00:00:00 2001 From: ornicar Date: Sun, 6 Feb 2011 16:18:51 -0800 Subject: [PATCH] [HttpKernel] Fix issue in SQLite profiler storage when PDO fails to prepare a statement --- .../Component/HttpKernel/Profiler/SQLiteProfilerStorage.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Symfony/Component/HttpKernel/Profiler/SQLiteProfilerStorage.php b/src/Symfony/Component/HttpKernel/Profiler/SQLiteProfilerStorage.php index f82ecec163..fc090d3904 100644 --- a/src/Symfony/Component/HttpKernel/Profiler/SQLiteProfilerStorage.php +++ b/src/Symfony/Component/HttpKernel/Profiler/SQLiteProfilerStorage.php @@ -146,6 +146,11 @@ class SQLiteProfilerStorage implements ProfilerStorageInterface protected function exec($db, $query, array $args = array()) { $stmt = $db->prepare($query); + + if (false === $stmt) { + throw new \RuntimeException('The database cannot successfully prepare the statement'); + } + if ($db instanceof \SQLite3) { foreach ($args as $arg => $val) { $stmt->bindValue($arg, $val, is_int($val) ? \SQLITE3_INTEGER : \SQLITE3_TEXT);