File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
packages/server/src/api/rest Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -723,7 +723,7 @@ class RequestHandler extends APIHandlerBase {
723723 if ( parsed . data . relationships ) {
724724 for ( const [ key , data ] of Object . entries < any > ( parsed . data . relationships ) ) {
725725 const typeInfo = this . typeMap [ key ] ;
726- if ( typeInfo . idFields . length > 1 ) {
726+ if ( typeInfo && typeInfo . idFields . length > 1 ) {
727727 typeInfo . idFields . forEach ( ( field , index ) => {
728728 attributes [ field . name ] = this . coerce ( field . type , data . data . id . split ( this . idDivider ) [ index ] ) ;
729729 } ) ;
@@ -773,7 +773,7 @@ class RequestHandler extends APIHandlerBase {
773773 // Remove attributes that are present in compound id relationships, as they are not expected by Prisma
774774 for ( const [ key ] of Object . entries < any > ( relationships ) ) {
775775 const typeInfo = this . typeMap [ key ] ;
776- if ( typeInfo . idFields . length > 1 ) {
776+ if ( typeInfo && typeInfo . idFields . length > 1 ) {
777777 typeInfo . idFields . forEach ( ( field ) => {
778778 delete attributes [ field . name ] ;
779779 } ) ;
You can’t perform that action at this time.
0 commit comments