Surround with wrapper-if...  Google's App Engine PHP's PDO-Driver returns a boolean instead of an empty resource-object.