mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-24 20:42:43 +00:00
Prevent loading of undefined renderer or theme themebundle.
This commit is contained in:
@@ -43,7 +43,9 @@ const HomePage = createClass({
|
||||
editor : React.createRef(null),
|
||||
|
||||
componentDidMount : function() {
|
||||
fetchThemeBundle(this, this.props.brew.renderer, this.props.brew.theme);
|
||||
if(this.props.brew.renderer || this.props.brew.theme){
|
||||
fetchThemeBundle(this, this.props.brew.renderer, this.props.brew.theme);
|
||||
}
|
||||
},
|
||||
|
||||
handleSave : function(){
|
||||
|
||||
@@ -32,7 +32,9 @@ const SharePage = createClass({
|
||||
componentDidMount : function() {
|
||||
document.addEventListener('keydown', this.handleControlKeys);
|
||||
|
||||
fetchThemeBundle(this, this.props.brew.renderer, this.props.brew.theme);
|
||||
if(this.props.brew.renderer || this.props.brew.theme){
|
||||
fetchThemeBundle(this, this.props.brew.renderer, this.props.brew.theme);
|
||||
}
|
||||
},
|
||||
|
||||
componentWillUnmount : function() {
|
||||
|
||||
@@ -89,7 +89,6 @@ app.get('/', (req, res, next)=>{
|
||||
title : 'Homepage',
|
||||
description : 'Homepage'
|
||||
};
|
||||
|
||||
splitTextStyleAndMetadata(req.brew);
|
||||
return next();
|
||||
});
|
||||
@@ -500,7 +499,6 @@ app.use(async (err, req, res, next)=>{
|
||||
pureError : getPureError(err)
|
||||
};
|
||||
req.customUrl= '/error';
|
||||
|
||||
const page = await renderPage(req, res);
|
||||
if(!page) return;
|
||||
res.send(page);
|
||||
|
||||
Reference in New Issue
Block a user