Delete unused patch
This commit is contained in:
parent
f11bd2392b
commit
1c11c0d5e4
@ -1,47 +0,0 @@
|
|||||||
From 519fb7e761447245fed9bb2de02e894b71ccae2f Mon Sep 17 00:00:00 2001
|
|
||||||
From: Vincent van Dam <vvandam@sandvine.com>
|
|
||||||
Date: Thu, 22 Sep 2016 14:48:05 +0200
|
|
||||||
Subject: [PATCH] Fix panic when encoding undef scalars
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
|
||||||
---
|
|
||||||
lib/Encode/Encoder.pm | 4 +++-
|
|
||||||
t/undef.t | 8 ++++++++
|
|
||||||
2 files changed, 11 insertions(+), 1 deletion(-)
|
|
||||||
create mode 100644 t/undef.t
|
|
||||||
|
|
||||||
diff --git a/lib/Encode/Encoder.pm b/lib/Encode/Encoder.pm
|
|
||||||
index 23e0349..fef4e9b 100644
|
|
||||||
--- a/lib/Encode/Encoder.pm
|
|
||||||
+++ b/lib/Encode/Encoder.pm
|
|
||||||
@@ -85,7 +85,9 @@ sub AUTOLOAD {
|
|
||||||
from_to( $self->{data}, $self->{encoding}, $obj->name, 1 );
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
- $self->{data} = $obj->encode( $self->{data}, 1 );
|
|
||||||
+ if ( defined($self->{data}) ) {
|
|
||||||
+ $self->{data} = $obj->encode( $self->{data}, 1 );
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
$self->{encoding} = $obj->name;
|
|
||||||
return $self;
|
|
||||||
diff --git a/t/undef.t b/t/undef.t
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000..ad8bcd6
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/t/undef.t
|
|
||||||
@@ -0,0 +1,8 @@
|
|
||||||
+use Encode::Encoder qw(encoder);
|
|
||||||
+
|
|
||||||
+use Test::More;
|
|
||||||
+plan tests => 1;
|
|
||||||
+
|
|
||||||
+my $emptyutf8;
|
|
||||||
+eval { $c = encoder($emptyutf8)->utf8; };
|
|
||||||
+ok(!$@,"crashed encoding undef variable ($@)");
|
|
||||||
--
|
|
||||||
2.7.4
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user