sapmentors / cap-community

SAP CAP Community
MIT License
97 stars 26 forks source link

"undefined" chained with Buffer data #112

Open rlopmar opened 2 years ago

rlopmar commented 2 years ago

https://github.com/sapmentors/cap-community/blob/c5ac508d41d91895cea74fa38dcc09d73c3b565b/examples/media-handling/srv/media-service.js#L18

Hi, in the media-service example, if we save the Buffer chunks like in the mentioned line 18, the Buffer data gets concatenated with an "undefined" string (please check the image).

This can be solved changing that line with content ? (content += dataChunk) : (content = dataChunk);

image