File tree Expand file tree Collapse file tree 3 files changed +22
-6
lines changed Expand file tree Collapse file tree 3 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -57,10 +57,12 @@ export class Dialog {
57
57
console . log ( "[Dialog] saveCard: Found notebook:" , notebook . title . label ) ;
58
58
notebook . revealed . then ( ( ) => {
59
59
60
- for ( const cell of notebook . content . model . cells ) {
61
- const shared_cell_mapping = cell . sharedModel ;
62
- if ( shared_cell_mapping . cell_type === 'code' ) {
63
- allCellContent += shared_cell_mapping . getSource ( ) + '\n\n' ;
60
+ if ( notebook . content . model ) {
61
+ for ( const cell of notebook . content . model . cells ) {
62
+ const shared_cell_mapping = cell . sharedModel ;
63
+ if ( shared_cell_mapping . cell_type === 'code' ) {
64
+ allCellContent += shared_cell_mapping . getSource ( ) + '\n\n' ;
65
+ }
64
66
}
65
67
}
66
68
Original file line number Diff line number Diff line change @@ -84,7 +84,21 @@ export class EmbeddedKernel extends BaseKernel {
84
84
const codeToSave = code . split ( saveString ) [ 1 ] . trim ( ) ;
85
85
// pass the "stream" to the saveCodeToDevice method
86
86
const result = await this . serviceContainer . saveCodeToDevice ( codeToSave , this . outputResponse . bind ( this ) ) ;
87
- return result ;
87
+ if ( result && result . status === 'ok' ) {
88
+ return {
89
+ status : 'ok' ,
90
+ execution_count : this . executionCount ,
91
+ user_expressions : { } ,
92
+ } ;
93
+ } else {
94
+ return {
95
+ status : 'error' ,
96
+ execution_count : this . executionCount ,
97
+ ename : result ?. ename || 'SaveError' ,
98
+ evalue : result ?. evalue || 'Error saving code' ,
99
+ traceback : result ?. traceback || [ 'Error saving code' ] ,
100
+ } ;
101
+ }
88
102
}
89
103
90
104
try {
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ export default class WelcomePanel {
94
94
95
95
constructor (
96
96
private serviceContainer : ServiceContainer ,
97
- private app ? : JupyterLiteServer
97
+ private app : JupyterLiteServer
98
98
) {
99
99
100
100
this . element = document . createElement ( 'div' ) ;
You can’t perform that action at this time.
0 commit comments