From 94240a06f2c3475e3617d8718b8e4fed435d07f0 Mon Sep 17 00:00:00 2001 From: Christopher Vagnetoft Date: Sat, 18 Dec 2021 14:37:14 +0100 Subject: [PATCH] Bugfix: PDO shell plugin * Fix broken .set command * Prevent crash if database not available --- plugins/com.noccy.pdo.shell/Shell/PdoShell.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/com.noccy.pdo.shell/Shell/PdoShell.php b/plugins/com.noccy.pdo.shell/Shell/PdoShell.php index 7774ee8..2e6b874 100644 --- a/plugins/com.noccy.pdo.shell/Shell/PdoShell.php +++ b/plugins/com.noccy.pdo.shell/Shell/PdoShell.php @@ -218,7 +218,7 @@ class PdoShell { $this->output->writeln("No such option {$varname}"); return; } - $this->options[$varname] = $args; + $this->options[$varname] = $value; } else { $this->output->writeln(var_export($this->options[$varname]??null,true)); } @@ -291,9 +291,9 @@ class PdoShell { $this->output->writeln("No database resource selected"); return; } - $pdo = $this->db->getPDO(); try { + $pdo = $this->db->getPDO(); $stmt = $pdo->prepare($query); $stmt->execute($params); $res = $stmt->fetchAll(\PDO::FETCH_ASSOC);