Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent the app from crashing when no theme is specified #474

Merged
merged 1 commit into from
Jul 8, 2016

Conversation

astorije
Copy link
Member

@astorije astorije commented Jul 8, 2016

defaults/config.js says:

    // @default  "themes/example.css"

However, without this fix, not setting a theme makes the app crash with:

lodash.templateSources[0]:10
((__t = ( theme ? theme : "themes/example.css" )) == null ? '' : __t) +
          ^

ReferenceError: theme is not defined
    at eval (lodash.templateSources[0]:10:11)
    at /Users/jeremie/Perso/lounge/src/server.js:103:11
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:380:3)

We have been setting default inline like this in other places. Even though it's not optimal, it's better than crashing :-)

@astorije astorije added Type: Bug Issues that report and PRs that solve any defects that cause unexpected behaviors. second review needed labels Jul 8, 2016
@astorije astorije added this to the 2.0.0 milestone Jul 8, 2016
@maxpoulin64 maxpoulin64 merged commit 28938be into master Jul 8, 2016
@maxpoulin64 maxpoulin64 deleted the astorije/fix-crash-theme branch July 8, 2016 06:09
@astorije
Copy link
Member Author

astorije commented Jul 8, 2016

It looks like this was not needed after #387, as explained in your comment: #475 (comment)
I was testing this on an outdated version of the code, forgetting the branch I was in was not up-to-date with master...

I'll test and if it's working, cleanup the uses of inline defaults like this one and others.

matburnham pushed a commit to matburnham/lounge that referenced this pull request Sep 6, 2017
Prevent the app from crashing when no theme is specified
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issues that report and PRs that solve any defects that cause unexpected behaviors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants