[dart:html] minor fix to clearWatch.

This is a fix to not include a null assert when it's
possible the value was null.

Fixes https://github.com/dart-lang/sdk/issues/49972

CoreLibraryReviewExempt: bug fix only affecting html library implementation
Change-Id: I26e6ebf3dc2d1ea3f9f458a32f519c5235e6d273
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350982
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
This commit is contained in:
Sigmund Cherem
2024-02-08 23:23:20 +00:00
committed by Commit Queue
parent 502d230c06
commit 5941ee7560
2 changed files with 4 additions and 4 deletions
@@ -52,8 +52,8 @@ $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS
StreamController<Geoposition> controller =
new StreamController<Geoposition>(sync: true,
onCancel: () {
assert(watchId != null);
_clearWatch(watchId$NULLASSERT);
final id = watchId;
if (id != null) _clearWatch(id);
}
);
controller.onListen = () {