Skip to content
3 changes: 3 additions & 0 deletions src/libs/actions/Report.js
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,9 @@ function fetchOrCreateChatReport(participants, shouldNavigate = true) {
const simplifiedReportObject = getSimplifiedReportObject(data);
Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${data.reportID}`, simplifiedReportObject);

// Fetch the personal details if there are any
PersonalDetails.getFromReportParticipants([simplifiedReportObject]);

if (shouldNavigate) {
// Redirect the logged in person to the new report
Navigation.navigate(ROUTES.getReportRoute(data.reportID));
Expand Down
5 changes: 5 additions & 0 deletions src/pages/DetailsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import CONST from '../CONST';
import * as ReportUtils from '../libs/ReportUtils';
import DateUtils from '../libs/DateUtils';
import * as Expensicons from '../components/Icon/Expensicons';
import FullscreenLoadingIndicator from '../components/FullscreenLoadingIndicator';
import MenuItem from '../components/MenuItem';
import AttachmentModal from '../components/AttachmentModal';
import PressableWithoutFocus from '../components/PressableWithoutFocus';
Expand Down Expand Up @@ -66,6 +67,10 @@ const getPhoneNumber = (details) => {

const DetailsPage = (props) => {
const details = props.personalDetails[props.route.params.login];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this line is probably what is causing this crash: #9545

It doesn't seem like a very safe way to access properties. It appears like there can be cases where props.route.params is undefined. Is that a valid case? Should this use lodashGet instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you are right. If you just open https://new.expensify.com/details without the param login, it crashes. I'll spin a small PR to fix it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, this feels low priority, I don't know how a user ended up with the URL without the parameter.

if (!details) {
// Personal details have not loaded yet
return <FullscreenLoadingIndicator />;
}
const isSMSLogin = Str.isSMSLogin(details.login);

// If we have a reportID param this means that we
Expand Down