Fix regresion from #2265 causing an extra default artboard to show up
This commit is contained in:
parent
b171eeba84
commit
22a900b35e
|
|
@ -595,7 +595,9 @@ impl MessageHandler<PortfolioMessage, PortfolioMessageData<'_>> for PortfolioMes
|
||||||
};
|
};
|
||||||
|
|
||||||
let Some(ref reference) = node_metadata.persistent_metadata.reference.clone() else {
|
let Some(ref reference) = node_metadata.persistent_metadata.reference.clone() else {
|
||||||
log::error!("could not get reference in deserialize_document");
|
// TODO: Investigate if this should be an expected case, because currently it runs hundreds of times normally.
|
||||||
|
// TODO: Either delete the commented out error below if this is normal, or fix the underlying issue if this is not expected.
|
||||||
|
// log::error!("could not get reference in deserialize_document");
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -118,9 +118,15 @@ impl<T> Instances<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: Default + Hash> Default for Instances<T> {
|
impl<T: Default + Hash + 'static> Default for Instances<T> {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self::new(T::default())
|
use core::any::TypeId;
|
||||||
|
if TypeId::of::<T>() == TypeId::of::<crate::Artboard>() {
|
||||||
|
// TODO: Remove the 'static trait bound when this special casing is removed by making all types return empty
|
||||||
|
Self::empty()
|
||||||
|
} else {
|
||||||
|
Self::new(T::default())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue