File tree Expand file tree Collapse file tree 3 files changed +19
-4
lines changed
Views/BasicLook/PageWrapper Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -317,7 +317,13 @@ fileprivate func buildInitialFetchSpec<Object: ActiveRecordType>
317317 if ( fs. sortOrderings? . count ?? 0 ) == 0 {
318318 fs. sortOrderings = dataSource. entity? . d2s. defaultSortOrderings ?? [ ]
319319 }
320- assert ( fs. sortOrderings != nil && !( fs. sortOrderings? . isEmpty ?? true ) )
320+ #if os(macOS)
321+ if !( fs. sortOrderings != nil && !( fs. sortOrderings? . isEmpty ?? true ) ) {
322+ globalD2SLogger. error ( " got no sort orderings for fetchspec: " , fs)
323+ }
324+ #else
325+ assert ( fs. sortOrderings != nil && !( fs. sortOrderings? . isEmpty ?? true ) )
326+ #endif
321327
322328 if let aux = auxiliaryQualifier {
323329 fs. qualifier = aux. and ( fs. qualifier)
Original file line number Diff line number Diff line change @@ -23,7 +23,13 @@ public extension BasicLook.PageWrapper.MasterDetail {
2323 private var selectedEntity : Entity ? {
2424 guard let entityName = selectedEntityName else { return nil }
2525 guard let entity = model [ entity: entityName] else {
26- fatalError ( " did not find entity: \( entityName) in \( model) " )
26+ #if os(macOS)
27+ globalD2SLogger. error ( " did not find entity: " , entityName,
28+ " in: " , model)
29+ return nil
30+ #else
31+ fatalError ( " did not find entity: \( entityName) in \( model) " )
32+ #endif
2733 }
2834 return entity
2935 }
@@ -71,7 +77,8 @@ public extension BasicLook.PageWrapper.MasterDetail {
7177 }
7278 else {
7379 EntityContent ( )
74- . environment ( \. entity, selectedEntity!)
80+ . environment ( \. entity,
81+ selectedEntity ?? D2SKeys . entity. defaultValue)
7582 }
7683 }
7784 . frame ( minWidth: 400 as CGFloat , idealWidth: 600 as CGFloat ,
Original file line number Diff line number Diff line change @@ -68,7 +68,9 @@ public extension BasicLook.PageWrapper.MasterDetail.EntityMasterDetailPage {
6868 EntityName ( )
6969 Spacer ( )
7070 }
71- . environment ( \. entity, { self . model [ entity: name] ! } ( ) )
71+ . environment ( \. entity, {
72+ self . model [ entity: name] ?? D2SKeys . entity. defaultValue
73+ } ( ) )
7274 . frame ( maxWidth: . infinity, maxHeight: . infinity)
7375 . foregroundColor ( self . colorForEntityName ( name) )
7476 . onTapGesture {
You can’t perform that action at this time.
0 commit comments