Skip to content

Commit cb1d270

Browse files
committed
Fixing forward bug
1 parent 3a7d8c7 commit cb1d270

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/DB.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,12 @@ public static function insertRequest(Update $update)
228228
$sth->bindParam(':date', $date, \PDO::PARAM_STR);
229229
$sth->bindParam(':chat_id', $chat_id, \PDO::PARAM_STR);
230230
//TODO insert the user in users table?
231-
$sth->bindParam(':forward_from', $forward_from->toJSON(), \PDO::PARAM_STR);
231+
if (is_object($forward_from)) {
232+
$forward = $forward_from->toJSON();
233+
} else {
234+
$forward = '';
235+
}
236+
$sth->bindParam(':forward_from', $forward, \PDO::PARAM_STR);
232237
$sth->bindParam(':forward_date', $forward_date, \PDO::PARAM_STR);
233238
$sth->bindParam(':reply_to_message', $reply_to_message, \PDO::PARAM_STR);
234239
$sth->bindParam(':text', $text, \PDO::PARAM_STR);

0 commit comments

Comments
 (0)