Skip to content

Commit

Permalink
fix: null errors in activity and translation view (#1899)
Browse files Browse the repository at this point in the history
  • Loading branch information
stepan662 authored Sep 7, 2023
1 parent 5a527d5 commit e7fbe1c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion webapp/src/component/activity/activityTools.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function getFieldLanguageTag(
entityData: ModifiedEntityModel
): string | undefined {
if (entityType == 'Translation') {
return entityData.relations?.['language'].data?.['tag'] as any as string;
return entityData.relations?.['language']?.data?.['tag'] as any as string;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ export const useEditService = ({ translations, viewRefs }: Props) => {
translations.selectedLanguages
);

if (result) {
if (result?.translations) {
Object.entries(result.translations).forEach(([lang, translation]) =>
translations.changeTranslations([
{ keyId, language: lang, value: translation },
Expand Down

0 comments on commit e7fbe1c

Please sign in to comment.