https://bugzilla.wikimedia.org/show_bug.cgi?id=52198
--- Comment #4 from Krinkle <[email protected]> --- (In reply to comment #3) > (In reply to comment #2) > > > > > if (content.params) { > > > > If we had used coffescript instead of plain JS, it would be so simple to > > write > > that as: > > if content?.params > > ... > > > > Now I assume we'll need to do it manually as > > if (typeof content !== "undefined" && content !== null && content.params) > > { > > ... > > } > It's much easier than that, you can just do if ( content && content.params ) > . > No need to use typeof and string comparisons and all that :) > > Really, though, content shouldn't be undefined in the first place. Indeed, guarding it with an if statement for content? itself is undesirable because the error is elsewhere. -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ Wikibugs-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikibugs-l
