A new user interface for you! Read more...

File jsxd-update-get-2.patch of Package jsxd

From 68422d81426bf129aa79b26cba29d392d24e01f1 Mon Sep 17 00:00:00 2001
From: Led <ledest@gmail.com>
Date: Thu, 28 Jan 2016 15:45:43 +0200
Subject: [PATCH] jsxd: update get/2

---
 src/jsxd.erl | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/jsxd.erl b/src/jsxd.erl
index a4af0fe..8925544 100644
--- a/src/jsxd.erl
+++ b/src/jsxd.erl
@@ -95,10 +95,6 @@ get([Key], [{_, _} | _T] = Obj) when is_binary(Key) ->
             undefined
     end;
 
-%% This faults when the key has a wrong format.
-get([_Key], _Obj) ->
-    undefined;
-
 get([Key | Keys], Obj) when is_list(Obj),
                             (is_binary(Key) orelse
                              is_integer(Key)) ->
@@ -107,7 +103,11 @@ get([Key | Keys], Obj) when is_list(Obj),
             jsxd:get(Keys, Obj1);
         _ ->
             undefined
-    end.
+    end;
+
+%% This faults when the key has a wrong format.
+get(_Key, _Obj) ->
+    undefined.
 
 -spec select(Keys::[binary()], Obj::object()) -> Obj::object().
 select(Keys, Obj) ->
-- 
2.1.4