File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
browser/main/modals/PreferencesModal Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -27,12 +27,14 @@ class SnippetTab extends React.Component {
27
27
28
28
handleSnippetSelect ( snippet ) {
29
29
const { currentSnippet } = this . state
30
- if ( currentSnippet === null || currentSnippet . id !== snippet . id ) {
31
- dataApi . fetchSnippet ( snippet . id ) . then ( changedSnippet => {
32
- // notify the snippet editor to load the content of the new snippet
33
- this . snippetEditor . onSnippetChanged ( changedSnippet )
34
- this . setState ( { currentSnippet : changedSnippet } )
35
- } )
30
+ if ( snippet !== null ) {
31
+ if ( currentSnippet === null || currentSnippet . id !== snippet . id ) {
32
+ dataApi . fetchSnippet ( snippet . id ) . then ( changedSnippet => {
33
+ // notify the snippet editor to load the content of the new snippet
34
+ this . snippetEditor . onSnippetChanged ( changedSnippet )
35
+ this . setState ( { currentSnippet : changedSnippet } )
36
+ } )
37
+ }
36
38
}
37
39
}
38
40
You can’t perform that action at this time.
0 commit comments