Browse Source

fixed crash on error handling

tags/0.1.0
Robin Thoni 9 years ago
parent
commit
db51fe7b5d
1 changed files with 3 additions and 2 deletions
  1. 3
    2
      src/request.js

+ 3
- 2
src/request.js View File

68
 
68
 
69
                 $http(params)
69
                 $http(params)
70
                     .success(function (result, status) {
70
                     .success(function (result, status) {
71
-                        if (result.Message != null) {
72
-                            reject(defered, result.Message, status, promise);
71
+                        if (result == null || result.Message != null) {
72
+                            var message = result == null ? "Failed to parse response" : result.Message;
73
+                            reject(defered, message, status, promise);
73
                         }
74
                         }
74
                         else {
75
                         else {
75
                             resolve(defered, result.Data, promise);
76
                             resolve(defered, result.Data, promise);

Loading…
Cancel
Save