lib: remove useless comparison on null that broke tests
authorJean Privat <jean@pryen.org>
Sat, 11 Oct 2014 17:22:24 +0000 (13:22 -0400)
committerJean Privat <jean@pryen.org>
Sat, 11 Oct 2014 17:23:02 +0000 (13:23 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

lib/mnit/mnit_injected_input.nit
lib/nitcorn/http_request.nit

index c590a85..4ed9664 100644 (file)
@@ -76,12 +76,12 @@ redef class App
        redef fun setup
        do
                var env = "MNIT_SRAND".environ
-               if env != null and env != "" then
+               if env != "" then
                        srand_from(env.to_i)
                end
 
                var input = "MNIT_READ_INPUT".environ
-               if input != null and input != "" then
+               if input != "" then
                        injected_input_stream = new IFStream.open(input)
                        print "GET injected_input_stream {input}"
                end
index c52a4a5..47e6823 100644 (file)
@@ -149,10 +149,6 @@ class HttpRequestParser
                                var parts = line.split_once_on('=')
                                if parts.length > 1 then
                                        var decoded = parts[1].replace('+', " ").from_percent_encoding
-                                       if decoded == null then
-                                               print "decode error"
-                                               continue
-                                       end
                                        http_request.post_args[parts[0]] = decoded
                                        http_request.all_args[parts[0]] = decoded
                                else