Closed davej closed 8 years ago
I was getting null values in my objects when sent over IPC, for example the message got sent as:
null
{ "type":"ADD_SITES", "payload":[ { "name":"Stark Industries", "id":"1234" }, { "name":"CHAOM", "id":"5678" }, { "name":"Oceanic Airlines", "id":"1111" }, { "name":"Marketing Site", "id":"9999" } ], "source":"browser", "data":{ "updated":{ "sites":[ { "name":"Stark Industries", "id":"1234" }, { "name":"CHAOM", "id":"5678" }, { "name":"Oceanic Airlines", "id":"1111" }, { "name":"Marketing Site", "id":"9999" } ] }, "deleted":{} } }
But was received as:
{ "type":"ADD_SITES", "payload":[ { "name":"Stark Industries", "id":"1234" }, { "name":"CHAOM", "id":"5678" }, { "name":"Oceanic Airlines", "id":"1111" }, { "name":"Marketing Site", "id":"9999" } ], "source":"browser", "data":{ "updated":{ "sites":[ null, null, null, null ] }, "deleted":{} } }
This seems to be related to https://github.com/atom/electron/issues/874. It can be easily fixed by serializing the action to JSON. I'll do a PR now.
I was getting
null
values in my objects when sent over IPC, for example the message got sent as:But was received as:
This seems to be related to https://github.com/atom/electron/issues/874. It can be easily fixed by serializing the action to JSON. I'll do a PR now.