Permalink
Browse files

Merge branch 'MDL-36609_master' of git://github.com/markn86/moodle

  • Loading branch information...
Sam Hemelryk
Sam Hemelryk committed Nov 26, 2012
2 parents 4d9e846 + 62d2105 commit 8a423efda9684a889458141d4f81af669957df55
Showing with 9 additions and 4 deletions.
  1. +9 −4 lib/javascript-static.js
View
@@ -340,11 +340,16 @@ M.util.init_maximised_embed = function(Y, id) {
if (Y.Lang.isString(el)) {
el = Y.one('#' + el);
}
- var val = el.getStyle(prop);
- if (val == 'auto') {
- val = el.getComputedStyle(prop);
+ // Ensure element exists.
+ if (el) {
+ var val = el.getStyle(prop);
+ if (val == 'auto') {
+ val = el.getComputedStyle(prop);
+ }
+ return parseInt(val);
+ } else {
+ return 0;
}
- return parseInt(val);
};
var resize_object = function() {

0 comments on commit 8a423ef

Please sign in to comment.