@@ -189,7 +189,8 @@ IonicTask.prototype.fetchCodepen = function() {
189189 var proxy = process . env . PROXY || null ;
190190
191191 request ( { url : codepenUrl + '.html' , proxy : proxy } , function ( err , res , html ) {
192- if ( ! err && res && res . statusCode === 200 && html ) {
192+ if ( ! err && res && res . statusCode === 200 ) {
193+ html = html || '' ;
193194
194195 if ( html . indexOf ( '<!DOCTYPE html>' ) < 0 ) {
195196 html = '<!DOCTYPE html>\n' + html ;
@@ -214,7 +215,9 @@ IonicTask.prototype.fetchCodepen = function() {
214215 } ) ;
215216
216217 request ( { url : codepenUrl + '.css' , proxy : proxy } , function ( err , res , css ) {
217- if ( ! err && res && res . statusCode === 200 && css ) {
218+ if ( ! err && res && res . statusCode === 200 ) {
219+ css = css || '' ;
220+
218221 var cssPath = path . join ( wwwPath , 'css' ) ;
219222 if ( ! fs . existsSync ( cssPath ) ) {
220223 fs . mkdirSync ( cssPath ) ;
@@ -226,7 +229,9 @@ IonicTask.prototype.fetchCodepen = function() {
226229 } ) ;
227230
228231 request ( { url : codepenUrl + '.js' , proxy : proxy } , function ( err , res , js ) {
229- if ( ! err && res && res . statusCode === 200 && js ) {
232+ if ( ! err && res && res . statusCode === 200 ) {
233+ js = js || '' ;
234+
230235 var jsPath = path . join ( wwwPath , 'js' ) ;
231236 if ( ! fs . existsSync ( jsPath ) ) {
232237 fs . mkdirSync ( jsPath ) ;
0 commit comments