With the previous change, if a file was added to the toplevel container, a
critical would occur since its parent is not a DummyContainer and thus the
cast resulted in NULL.
// Only add new containers. There's not much about a container so
// we skip the updated signal
var dummy_parent = parent as DummyContainer;
- if (dummy_parent != null &&
- dummy_parent.children.contains (MediaCache.get_id (file))) {
- dummy_parent.add_child_tracked.begin (container);
+ if (dummy_parent == null ||
+ !dummy_parent.children.contains (MediaCache.get_id (file))) {
+ (parent as TrackableContainer).add_child_tracked.begin (container);
}
return true;