diff --git a/lib/private/db/adapteroci8.php b/lib/private/db/adapteroci8.php
index 6e7857e6620d52eb77b716f5577dbd5a1957c639..76c265bc178beab4e32bb6b9fcf1f30e4dbb3b22 100644
--- a/lib/private/db/adapteroci8.php
+++ b/lib/private/db/adapteroci8.php
@@ -26,6 +26,9 @@ namespace OC\DB;
 
 class AdapterOCI8 extends Adapter {
 	public function lastInsertId($table) {
+		if (is_null($table)) {
+			throw new \InvalidArgumentException('Oracle requires a table name to be passed into lastInsertId()');
+		}
 		if ($table !== null) {
 			$suffix = '_SEQ';
 			$table = '"' . $table . $suffix . '"';
diff --git a/lib/private/db/connection.php b/lib/private/db/connection.php
index 1b86d3d383ac69e555180bffb13e62e7ffff56c2..85b1b7cd5ea07e7d95b691ed6a3f21b243f8a02b 100644
--- a/lib/private/db/connection.php
+++ b/lib/private/db/connection.php
@@ -214,8 +214,7 @@ class Connection extends \Doctrine\DBAL\Connection implements IDBConnection {
 	 * @param string $seqName Name of the sequence object from which the ID should be returned.
 	 * @return string A string representation of the last inserted ID.
 	 */
-	public function lastInsertId($seqName = null)
-	{
+	public function lastInsertId($seqName = null) {
 		if ($seqName) {
 			$seqName = $this->replaceTablePrefix($seqName);
 		}