Skip to content
Browse files

Accounting for drivers that do not implement escape

  • Loading branch information...
1 parent e28a967 commit 0d7ba4209f75c18d1b6d509a08b1330390952570 @mariano committed Jun 7, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 query.cc
View
6 query.cc
@@ -1434,7 +1434,11 @@ std::string node_db::Query::value(v8::Local<v8::Value> value, bool inArray, bool
v8::String::Utf8Value currentString(value->ToString());
std::string string = *currentString;
if (escape) {
- currentStream << this->connection->quoteString << this->connection->escape(string) << this->connection->quoteString;
+ try {
+ currentStream << this->connection->quoteString << this->connection->escape(string) << this->connection->quoteString;
+ } catch(node_db::Exception& exception) {
+ currentStream << this->connection->quoteString << string << this->connection->quoteString;
+ }
} else {
currentStream << string;
}

0 comments on commit 0d7ba42

Please sign in to comment.
Something went wrong with that request. Please try again.