File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
frontend/src/app/features/work-packages/components/wp-fast-table/builders/rows Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -216,14 +216,17 @@ export class SingleRowBuilder {
216216
217217 protected buildEmptyRow ( workPackage :WorkPackageResource , row :HTMLTableRowElement ) :[ HTMLTableRowElement , boolean ] {
218218 const change = this . workPackageTable . editing . change ( workPackage ) ;
219- const cells :{ [ attribute : string ] : HTMLTableCellElement } = { } ;
219+ const cells :Record < string , HTMLTableCellElement > = { } ;
220220
221221 if ( change && ! change . isEmpty ( ) ) {
222222 // Try to find an old instance of this row
223- const oldRow = locateTableRowByIdentifier ( this . classIdentifier ( workPackage ) ) ! ;
223+ const oldRow = locateTableRowByIdentifier ( this . classIdentifier ( workPackage ) ) ;
224224
225225 change . changedAttributes . forEach ( ( attribute :string ) => {
226- cells [ attribute ] = oldRow . querySelector ( `.${ tdClassName } .${ attribute } ` ) ! ;
226+ const oldCell = oldRow ?. querySelector < HTMLTableCellElement > ( `.${ tdClassName } .${ attribute } ` ) ;
227+ if ( oldCell ) {
228+ cells [ attribute ] = oldCell ;
229+ }
227230 } ) ;
228231 }
229232
You can’t perform that action at this time.
0 commit comments