lib & contrib: update imports
[nit.git] / lib / android / bundle / bundle.nit
index 82bea46..e02702a 100644 (file)
@@ -19,7 +19,7 @@
 module bundle
 
 import serialization
-import json::serialization
+import json
 
 import platform
 import activities
@@ -543,13 +543,15 @@ class Bundle
        # Returns `null` if none or if it's the wrong value type
        fun string(key: String): nullable String
        do
-               sys.jni_env.push_local_frame(1)
-               var return_value = native_bundle.get_string(key.to_java_string).to_s
-               sys.jni_env.pop_local_frame
+               sys.jni_env.push_local_frame(2)
 
-               if return_value == "" then return null
+               var jstr = native_bundle.get_string(key.to_java_string)
+               var str = null
+               if not jstr.is_java_null then str = jstr.to_s
 
-               return return_value
+               sys.jni_env.pop_local_frame
+
+               return str
        end
 
        # Retrieves the `Bool` value corresponding to the given key