[media controller applet] Fix JS error on no xesam:url data set
ClosedPublic

Authored by kossebau on Mar 4 2018, 6:55 PM.

Diff Detail

Repository
R120 Plasma Workspace
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kossebau created this revision.Mar 4 2018, 6:55 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMar 4 2018, 6:55 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
kossebau requested review of this revision.Mar 4 2018, 6:55 PM
broulik accepted this revision.Mar 5 2018, 8:25 AM

My approach would have been

var xesamUrl = (metadata["xesam:url"] || "").toString();

but this is fine and more understandable for non-JS developers :)

This revision is now accepted and ready to land.Mar 5 2018, 8:25 AM

My approach would have been

var xesamUrl = (metadata["xesam:url"] || "").toString();

but this is fine and more understandable for non-JS developers :)

It took me years to no longer be a JS developer ;) But never seen this pattern before, think this is more nice, so will go for that :)

This revision was automatically updated to reflect the committed changes.