Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Remove Mojo::JSON warnings #202

Closed
wants to merge 1 commit into from

2 participants

@sharifulin

No description provided.

@kraih
Owner

Tests and description missing.

@kraih kraih closed this
@sharifulin
@kraih
Owner

I'm going to need more before i can apply it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/Mojo/JSON.pm
View
5 lib/Mojo/JSON.pm
@@ -66,7 +66,7 @@ sub decode {
# Wide characters
$self->error('Wide character in input.') and return
- unless utf8::downgrade($_, 1);
+ unless utf8::downgrade($string, 1);
# Detect and decode unicode
my $encoding = 'UTF-8';
@@ -78,6 +78,9 @@ sub decode {
}
Mojo::Util::decode $encoding, $string;
+ # Missing input
+ $self->error('Empty input after decode.') and return unless $string;
+
# Object or array
my $res = eval {
local $_ = $string;
Something went wrong with that request. Please try again.