@@ -7,6 +7,7 @@ use warnings;
77
88use Moo;
99use Carp;
10+ use Scalar::Util qw( blessed ) ;
1011
1112use Thrift;
1213use Thrift::Socket;
@@ -131,7 +132,7 @@ has _session => (
131132 is => ' rwp' ,
132133 isa => sub {
133134 die " Session isn't a Thrift::API::HiveClient2::TOpenSessionResp"
134- if !$_ [0]-> isa(' Thrift::API::HiveClient2::TOpenSessionResp' ) },
135+ if ! blessed( $_ [0]) || ! $_ [0]-> isa(' Thrift::API::HiveClient2::TOpenSessionResp' ) },
135136 lazy => 1,
136137 builder => ' _build_session' ,
137138);
@@ -164,7 +165,7 @@ has _session_handle => (
164165 is => ' rwp' ,
165166 isa => sub {
166167 die " Session handle isn't a Thrift::API::HiveClient2::TSessionHandle"
167- if !$_ [0]-> isa(' Thrift::API::HiveClient2::TSessionHandle' ) },
168+ if ! blessed( $_ [0]) || ! $_ [0]-> isa(' Thrift::API::HiveClient2::TSessionHandle' ) },
168169 lazy => 1,
169170 builder => ' _build_session_handle' ,
170171);
@@ -178,7 +179,7 @@ has _operation => (
178179 is => " rwp" ,
179180 isa => sub {
180181 die " Operation isn't a Thrift::API::HiveClient2::TExecuteStatementResp"
181- if defined $_ [0] && ! $_ [0]-> isa(' Thrift::API::HiveClient2::TExecuteStatementResp' ) },
182+ if defined $_ [0] && ( ! blessed( $_ [0]) || ! $_ [0] -> isa(' Thrift::API::HiveClient2::TExecuteStatementResp' ) ) },
182183 lazy => 1,
183184);
184185
@@ -187,7 +188,7 @@ has _operation_handle => (
187188 isa => sub {
188189 die
189190 " Operation handle isn't a Thrift::API::HiveClient2::TOperationHandle"
190- if defined $_ [0] && ! $_ [0]-> isa(' Thrift::API::HiveClient2::TOperationHandle' );
191+ if defined $_ [0] && ( ! blessed( $_ [0]) || ! $_ [0] -> isa(' Thrift::API::HiveClient2::TOperationHandle' ) );
191192 },
192193 lazy => 1,
193194);
0 commit comments