File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/lib/core/overlay/scroll Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,6 @@ export class ScrollDispatcher {
3434 /**
3535 * Registers a Scrollable with the service and listens for its scrolled events. When the
3636 * scrollable is scrolled, the service emits the event in its scrolled observable.
37- *
3837 * @param scrollable Scrollable instance to be registered.
3938 */
4039 register ( scrollable : Scrollable ) : void {
@@ -44,12 +43,13 @@ export class ScrollDispatcher {
4443
4544 /**
4645 * Deregisters a Scrollable reference and unsubscribes from its scroll event observable.
47- *
4846 * @param scrollable Scrollable instance to be deregistered.
4947 */
5048 deregister ( scrollable : Scrollable ) : void {
51- this . scrollableReferences . get ( scrollable ) . unsubscribe ( ) ;
52- this . scrollableReferences . delete ( scrollable ) ;
49+ if ( this . scrollableReferences . has ( scrollable ) ) {
50+ this . scrollableReferences . get ( scrollable ) . unsubscribe ( ) ;
51+ this . scrollableReferences . delete ( scrollable ) ;
52+ }
5353 }
5454
5555 /**
You can’t perform that action at this time.
0 commit comments