Skip to content

Commit 22a900b

Browse files
committed
Fix regresion from #2265 causing an extra default artboard to show up
1 parent b171eeb commit 22a900b

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

editor/src/messages/portfolio/portfolio_message_handler.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,9 @@ impl MessageHandler<PortfolioMessage, PortfolioMessageData<'_>> for PortfolioMes
595595
};
596596

597597
let Some(ref reference) = node_metadata.persistent_metadata.reference.clone() else {
598-
log::error!("could not get reference in deserialize_document");
598+
// TODO: Investigate if this should be an expected case, because currently it runs hundreds of times normally.
599+
// TODO: Either delete the commented out error below if this is normal, or fix the underlying issue if this is not expected.
600+
// log::error!("could not get reference in deserialize_document");
599601
continue;
600602
};
601603

node-graph/gcore/src/instances.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,15 @@ impl<T> Instances<T> {
118118
}
119119
}
120120

121-
impl<T: Default + Hash> Default for Instances<T> {
121+
impl<T: Default + Hash + 'static> Default for Instances<T> {
122122
fn default() -> Self {
123-
Self::new(T::default())
123+
use core::any::TypeId;
124+
if TypeId::of::<T>() == TypeId::of::<crate::Artboard>() {
125+
// TODO: Remove the 'static trait bound when this special casing is removed by making all types return empty
126+
Self::empty()
127+
} else {
128+
Self::new(T::default())
129+
}
124130
}
125131
}
126132

0 commit comments

Comments
 (0)