Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit f171fd2

Browse files
EladBezalelThomasBurleson
authored andcommitted
fix(grid-list): validate that row height is defined
- throwing more informative error about missing row height attribute fixes #6870 Closes #7348
1 parent b2afa36 commit f171fd2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/components/gridList/grid-list.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,10 @@ function GridListDirective($interpolate, $mdConstant, $mdGridLayout, $mdMedia) {
382382

383383
function getRowHeight() {
384384
var rowHeight = $mdMedia.getResponsiveAttribute(attrs, 'md-row-height');
385+
if (!rowHeight) {
386+
throw 'md-grid-list: md-row-height attribute was not found';
387+
}
388+
385389
switch (getRowMode()) {
386390
case 'fixed':
387391
return applyDefaultUnit(rowHeight);
@@ -395,6 +399,10 @@ function GridListDirective($interpolate, $mdConstant, $mdGridLayout, $mdMedia) {
395399

396400
function getRowMode() {
397401
var rowHeight = $mdMedia.getResponsiveAttribute(attrs, 'md-row-height');
402+
if (!rowHeight) {
403+
throw 'md-grid-list: md-row-height attribute was not found';
404+
}
405+
398406
if (rowHeight == 'fit') {
399407
return 'fit';
400408
} else if (rowHeight.indexOf(':') !== -1) {

0 commit comments

Comments
 (0)