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 {
34
34
/**
35
35
* Registers a Scrollable with the service and listens for its scrolled events. When the
36
36
* scrollable is scrolled, the service emits the event in its scrolled observable.
37
- *
38
37
* @param scrollable Scrollable instance to be registered.
39
38
*/
40
39
register ( scrollable : Scrollable ) : void {
@@ -44,12 +43,13 @@ export class ScrollDispatcher {
44
43
45
44
/**
46
45
* Deregisters a Scrollable reference and unsubscribes from its scroll event observable.
47
- *
48
46
* @param scrollable Scrollable instance to be deregistered.
49
47
*/
50
48
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
+ }
53
53
}
54
54
55
55
/**
You can’t perform that action at this time.
0 commit comments