PPS: fall back to sketchcode.program if sketchcode.document is null

This commit is contained in:
Jakub Valtar
2017-05-19 17:34:49 +02:00
parent 9c2352fa03
commit 17b9a6480d

View File

@@ -274,10 +274,14 @@ public class PreprocessingService {
for (SketchCode sc : sketch.getCode()) {
if (sc.isExtension("pde")) {
tabStartsList.append(workBuffer.length());
try {
workBuffer.append(sc.getDocumentText());
} catch (BadLocationException e) {
e.printStackTrace();
if (sc.getDocument() != null) {
try {
workBuffer.append(sc.getDocumentText());
} catch (BadLocationException e) {
e.printStackTrace();
}
} else {
workBuffer.append(sc.getProgram());
}
workBuffer.append('\n');
}