Browse Source

fixed crash on error handling

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

+ 3
- 2
src/request.js View File

77
                         }
77
                         }
78
                     })
78
                     })
79
                     .error(function (result, status) {
79
                     .error(function (result, status) {
80
-                        if (result.Message != null) {
81
-                            reject(defered, result.Message, status, promise);
80
+                        if (result == null || result.Message != null) {
81
+                            var message = result == null ? "Failed to parse response" : result.Message;
82
+                            reject(defered, message, status, promise);
82
                         }
83
                         }
83
                         else {
84
                         else {
84
                             reject(defered, result, status, promise);
85
                             reject(defered, result, status, promise);

Loading…
Cancel
Save