Skip to content

Commit

Permalink
Fixing issue with string detection in createOnMessageHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
mauritslamers committed Aug 16, 2010
1 parent 4a124df commit 3b3ec57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clients/SproutCore/ONRDataSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ SC.ONRDataSource = SC.DataSource.extend({
// if there is any binary data, there will be trouble...
if(event.data){
console.log("data in event: " + event.data);
var messages = (event.data instanceof String)? JSON.parse(event.data): event.data;
var messages = (SC.typeOf(event.data) === SC.T_STRING)? JSON.parse(event.data): event.data;
if(messages){
// check if messages is an array, if not, make one
var data = (messages instanceof Array)? messages: [messages];
Expand Down

0 comments on commit 3b3ec57

Please sign in to comment.