Redundant check in apps/email/js/ext/mailapi/drafts/composer.js

RESOLVED WORKSFORME

Status

Firefox OS
Gaia::E-Mail
RESOLVED WORKSFORME
3 years ago
3 years ago

People

(Reporter: Max Schaefer, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
On line 1314 (https://github.com/mozilla-b2g/gaia/blob/master/apps/email/js/ext/mailapi/drafts/composer.js#L1314), we read

    if(this._relatedAttachments && this._relatedAttachments){

Note the duplicate (and redundant) 'this._relatedAttachments'.

From context, I would guess this should instead be

    if(this._relatedAttachments && this._relatedAttachments.length){
Similarly to bug 1056020, this odd code is in a 3rd party lib and will be addressed by the upgrade to the email.js library suite in bug 885110.  Specifically, https://github.com/whiteout-io/mailbuild/blob/master/src/mailbuild.js which does not contain that code anymore.

Like that bug, I'm going to resolve this WFM since the code in question is silly but harmless since the for-loop inside the conditional clause will guard against 0-length arrays.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.