Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/candy-chat/candy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/contact.js')
-rw-r--r--src/core/contact.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/core/contact.js b/src/core/contact.js
index 51985a3..0f56ca9 100644
--- a/src/core/contact.js
+++ b/src/core/contact.js
@@ -113,7 +113,12 @@ Candy.Core.Contact.prototype.getStatus = function() {
highestResourcePriority;
$.each(this.data.resources, function(resource, obj) {
- var resourcePriority = parseInt(obj.priority, 10);
+ var resourcePriority;
+ if (obj.priority === undefined || obj.priority === '') {
+ resourcePriority = 0;
+ } else {
+ resourcePriority = parseInt(obj.priority, 10);
+ }
if (obj.show === '' || obj.show === null || obj.show === undefined) {
// TODO: Submit this as a bugfix to strophejs-plugins' roster plugin