yjbanov / butterfly

A web framework for Dart based on Flutter's widget model
Apache License 2.0
157 stars 13 forks source link

RenderDecoration RenderNode throws NPE on initial update #32

Closed jonahwilliams closed 6 years ago

jonahwilliams commented 7 years ago

Error:

require.js:143 Uncaught TypeError: Cannot read property 'Symbol(_configuration)' of null
    at butterfly.RenderEventRecognizer.new.update (node.dart:197)
    at butterfly.RenderEventRecognizer.new.update (events.dart:46)
    at butterfly._FlexRenderNode.new.update (node.dart:336)
    at butterfly._FlexRenderNode.new.update (layout.dart:59)
    at butterfly.RenderStatefulWidget.new.update (widget.dart:174)
    at butterfly.Tree.new.renderFrame (tree.dart:50)
    at butterfly.ButterflyModule._.renderFrame (butterfly.dart:70)
    at Object.dart._checkAndCall (dart_sdk.js:2275)
    at Object.dart.dcall (dart_sdk.js:2280)
    at platform_channel.PlatformChannel.new.invokeDart (platform_channel.dart:52)

Location is currentChild._configuration.

  @override
  @mustCallSuper
  void update(N newConfiguration, ElementUpdate update) {
    if (newConfiguration == _currentChild._configuration) {
      if (hasDescendantsNeedingUpdate) {
        _currentChild.update(newConfiguration.child, update);
      }
      return;
    }

in this case, currentChild is still null. Does this indicate some other invariant being violated, or should this update method just be updated to null check here.