Browse files

Merge branch 'MDL-36609_m23' of git://github.com/markn86/moodle into …

…MOODLE_23_STABLE
  • Loading branch information...
2 parents f9fa262 + 302808a commit 55f8a9c7666230fe27362e38a8ed59c8771bd37a Sam Hemelryk committed Nov 26, 2012
Showing with 9 additions and 4 deletions.
  1. +9 −4 lib/javascript-static.js
View
13 lib/javascript-static.js
@@ -333,11 +333,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 55f8a9c

Please sign in to comment.