Skip to content

Commit

Permalink
use lodashGet
Browse files Browse the repository at this point in the history
  • Loading branch information
rushatgabhane committed Jul 29, 2021
1 parent 69a06fa commit 6a629da
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/AttachmentModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, {PureComponent} from 'react';
import PropTypes from 'prop-types';
import {View} from 'react-native';
import Str from 'expensify-common/lib/str';
import lodashGet from 'lodash/get';
import CONST from '../CONST';
import Modal from './Modal';
import AttachmentView from './AttachmentView';
Expand Down Expand Up @@ -98,7 +99,7 @@ class AttachmentModal extends PureComponent {
* @returns {Boolean}
*/
isValidSize(file) {
return !file || parseInt(file.size, 10) < CONST.API_MAX_ATTACHMENT_SIZE;
return !file || lodashGet(file, 'size', 0) < CONST.API_MAX_ATTACHMENT_SIZE;
}

render() {
Expand Down

0 comments on commit 6a629da

Please sign in to comment.