Browse Source

default on string value if json decode fails

tags/0.1.11
Robin Thoni 8 years ago
parent
commit
853b9d9d86
1 changed files with 3 additions and 0 deletions
  1. 3
    0
      src/Utils/LuRoute.php

+ 3
- 0
src/Utils/LuRoute.php View File

@@ -70,6 +70,9 @@ class LuRoute {
70 70
             try
71 71
             {
72 72
                 $json = json_decode($value, true);
73
+                if (is_null($json)) {
74
+                    $json = $value . "";
75
+                }
73 76
                 $typedValue = call_user_func_array(array($class->getName(), "jsonDeserialize"), array($json));
74 77
             }
75 78
             catch (LuDboDeserializeException $e)

Loading…
Cancel
Save