Fix stupid sqlt parser regression
[dbsrgits/DBIx-Class-Historic.git] / lib / SQL / Translator / Parser / DBIx / Class.pm
index 2efc5b1..32fe04f 100644 (file)
@@ -33,7 +33,7 @@ use base qw(Exporter);
 sub parse {
     # this is a hack to prevent schema leaks due to a retarded SQLT implementation
     # DO NOT REMOVE (until SQLT2 is out, the all of this will be rewritten anyway)
-    Scalar::Util::weaken ($_[1]);
+    Scalar::Util::weaken ($_[1]) if ref ($_[1]);
 
     my ($tr, $data)   = @_;
     my $args          = $tr->parser_args;