fixed NPE on creating new Ipython notebook

This commit is contained in:
Ekaterina Tuzova
2014-11-13 13:33:08 +03:00
parent 40de4225b0
commit 189a2a1c68
@@ -106,7 +106,17 @@ public class IpnbFilePanel extends JPanel implements Scrollable, DataProvider, D
mySelectedCell = null;
myIpnbFile = IpnbParser.parseIpnbFile(myDocument, myVirtualFile.getPath());
if (myIpnbFile.getCells().isEmpty()) {
createAndAddCell(true);
CommandProcessor.getInstance().runUndoTransparentAction(new Runnable() {
public void run() {
ApplicationManager.getApplication().runWriteAction(new Runnable() {
public void run() {
createAndAddCell(true);
saveToFile();
}
});
}
});
}
} catch (IOException e) {
if (showError)