Closed Bug 575728 Opened 14 years ago Closed 14 years ago

Clone of undefined fails

Categories

(Skywriter Graveyard :: General, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mspear, Unassigned)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.1 (KHTML, like Gecko) Chrome/6.0.437.3 Safari/534.1
Build Identifier: tip (changeset:   1980:f583805647a7)

The settings persister object is set after all the plugin data is loaded in loginController in userident/index.js 

While loading the plugins, however, in registerMetadata() (bespin/plugins.js) there is a usage of util.clone() that is called on something that is undefined. The result is util.clone() throwing an Exception ("object is undefined" / "Uncaught TypeError: Cannot read property 'clone' of undefined"), preventing loginController from continuing and setting the Persister.

This was another easy fix. Instead of the current
  if (object.clone && typeof(object.clone) === 'function') {
Use:
  if (object && typeof(object.clone) === 'function') {

At least I think that will always work, as testing for object.clone is redundant. Even if object.clone is not defined typeof will still work on it (assuming object *is* defined in the first place (which I now test for), even if object is a number or boolean)


Reproducible: Always

Steps to Reproduce:
1. Use a fresh copy of bespin (I haven't pinpointed how "fresh" the copy needs to be. It might happen even in a well worn in copy. On the other hand you might need to clear local storage/cookies, and work off fresh clones (and run the usual bootstrap and paver incantations, perhaps even with a new server.port so the browser thinks it is a new site))
2. "set theme white" (or any setting you desire to use)
3. refresh
4. See the standard theme
Actual Results:  
Default settings are used

Expected Results:  
Saved/persisted settings should be used
Summary: Bespin not using persisted settings → Clone of undefined fails
Pushed in b9bb8bd133ca, thanks!
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: