fix: handle missing ERB

This commit is contained in:
Oliver Eyton-Williams
2020-07-24 15:58:17 +02:00
committed by Mrugesh Mohapatra
parent 78c3b42770
commit 2abefc27a2

View File

@@ -130,6 +130,9 @@ export const createFiles = createAction(types.createFiles, challengeFiles =>
// TODO: secure with tests
function getLines(contents, range) {
if (isEmpty(range)) {
return '';
}
const lines = contents.split('\n');
const editableLines = isEmpty(lines)
? []