Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 6d81ded

Browse files
committed
fix(ripple): prevent null error while using ripple
1 parent 9c56383 commit 6d81ded

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/core/services/ripple/ripple.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ function InkRippleService($window, $timeout) {
154154

155155
function updateElement(elem) {
156156
var index = ripples.indexOf(elem),
157-
state = states[index],
157+
state = states[index] || {},
158158
elemIsActive = ripples.length > 1 ? false : isActive,
159159
elemIsHeld = ripples.length > 1 ? false : isHeld;
160160
if (elemIsActive || state.animating || elemIsHeld) {
@@ -188,7 +188,7 @@ function InkRippleService($window, $timeout) {
188188
css = getRippleCss(size, left, top),
189189
elem = getRippleElement(css),
190190
index = ripples.indexOf(elem),
191-
state = states[index];
191+
state = states[index] || {};
192192

193193
rippleSize = size;
194194

0 commit comments

Comments
 (0)