Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1829)

Unified Diff: sky/sdk/lib/framework/rendering/box.dart

Issue 1162023010: Don't crash when removing a radio button (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: more asserts Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/framework/rendering/box.dart
diff --git a/sky/sdk/lib/framework/rendering/box.dart b/sky/sdk/lib/framework/rendering/box.dart
index 98fe65bc99240aace6b2d98dbf40132b90320e09..563dd423527dec6990fcc367fec2e61da51e172d 100644
--- a/sky/sdk/lib/framework/rendering/box.dart
+++ b/sky/sdk/lib/framework/rendering/box.dart
@@ -680,14 +680,20 @@ class RenderCustomPaint extends RenderProxyBox {
CustomPaintCallback _callback;
void set callback (CustomPaintCallback value) {
- assert(value != null);
+ assert(value != null || !attached);
if (_callback == value)
return;
_callback = value;
markNeedsPaint();
}
+ void attach() {
+ assert(_callback != null);
+ super.attach();
+ }
+
void paint(RenderObjectDisplayList canvas) {
+ assert(_callback != null);
_callback(canvas);
super.paint(canvas);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698