Ver Fonte

Outputs not available at construction time, so check before using them.

Ian Rose há 8 anos atrás
pai
commit
244372288a
1 ficheiros alterados com 3 adições e 1 exclusões
  1. 3 1
      packages/cells/src/model.ts

+ 3 - 1
packages/cells/src/model.ts

@@ -401,7 +401,9 @@ class CodeCellModel extends CellModel implements ICodeCellModel {
    * Handle a change to the trusted state.
    */
   onTrustedChanged(trusted: IObservableValue, args: ObservableValue.IChangedArgs): void {
-    this._outputs.trusted = args.newValue as boolean;
+    if (this._outputs) {
+      this._outputs.trusted = args.newValue as boolean;
+    }
     this.stateChanged.emit({
       name: 'trusted',
       oldValue: args.oldValue,