akserg/angular.dart.ui

Double Click on Modal Backdrop to Dismiss Gives Error

Closed this issue · 2 comments

Observed an error locally when double-clicking on the modal backdrop to dismiss. Console log below:

The null object does not have a method 'dismiss'.

NoSuchMethodError: method not found: 'dismiss'
Receiver: null
Arguments: ["backdrop click"]

STACKTRACE:
#0      Object._noSuchMethod (dart:core-patch/object_patch.dart:42)
#1      Object.noSuchMethod (dart:core-patch/object_patch.dart:45)
#2      ModalWindow.close (package:angular_ui/modal/modal.dart:116:21)
#3      Function._apply (dart:core-patch/function_patch.dart:7)
#4      Function.apply (dart:core-patch/function_patch.dart:28)
#5      StaticClosureMap.lookupFunction.<anonymous closure>     (package:angular/core/parser/static_closure_map.dart:37:25)
#6      ClosureMapLocalsAware.lookupFunction.<anonymous closure> (package:angular/core/parser/parser.dart:254:16)
#7      CallScope.eval (package:angular/core/parser/eval_calls.dart:27:25) 
#8      _UnwrapExceptionDecorator.eval (package:angular/core/parser/parser.dart:117:26)
#9      BoundExpression.call (package:angular/core/parser/syntax.dart:59:32)
#10     NgEvent._initListener.<anonymous closure> (package:angular/directive/ng_events.dart:142:39)
#11     _rootRunUnary (dart:async/zone.dart:915)
#12     _ZoneDelegate.runUnary (dart:async/zone.dart:510)
#13     VmTurnZone._onRunUnary.<anonymous closure> (package:angular/core/zone.dart:126:55)
#14     VmTurnZone._onRunBase (package:angular/core/zone.dart:108:16)
#15     VmTurnZone._onRunUnary (package:angular/core/zone.dart:126:7)
#16     _CustomZone.runUnary (dart:async/zone.dart:811)
#17     _CustomZone.runUnaryGuarded (dart:async/zone.dart:717)
#18     _CustomZone.bindUnaryCallback.<anonymous closure> (dart:async/zone.dart:743)

After a bit of digging, it appears that the change made on the ModalWindow to find the _top modal on the stack does not have a null check.

This can also be replicated in the example page.

I think a fix for this has been merged and the issue can be closed.

Ok