Commit 19d27351 by Dominik Prokop Committed by GitHub

Fix few null checks to make master green (#25965)

parent bd27be13
......@@ -86,7 +86,7 @@ export class ConfigEditor extends PureComponent<Props> {
label="Rollup indicator"
labelClass={'width-10'}
tooltip="Shows up as an info icon in panel headers when data is aggregated"
checked={options.jsonData.rollupIndicatorEnabled}
checked={!!options.jsonData.rollupIndicatorEnabled}
onChange={onUpdateDatasourceJsonDataOptionChecked(this.props, 'rollupIndicatorEnabled')}
/>
</div>
......
......@@ -84,6 +84,7 @@ type DebugField = {
value?: string;
href?: string;
};
function makeDebugFields(derivedFields: DerivedFieldConfig[], debugText: string): DebugField[] {
return derivedFields
.filter(field => field.name && field.matcherRegex)
......@@ -91,7 +92,7 @@ function makeDebugFields(derivedFields: DerivedFieldConfig[], debugText: string)
try {
const testMatch = debugText.match(field.matcherRegex);
const value = testMatch && testMatch[1];
let link: LinkModel<Field>;
let link: LinkModel<Field> = null;
if (field.url && value) {
link = getFieldLinksForExplore(
......
......@@ -518,7 +518,7 @@ export class LokiDatasource extends DataSourceApi<LokiQuery, LokiOptions> {
}
showContextToggle = (row?: LogRowModel) => {
return row.searchWords && row.searchWords.length > 0;
return row && row.searchWords && row.searchWords.length > 0;
};
throwUnless = (err: any, condition: boolean, target: LokiQuery) => {
......
......@@ -502,7 +502,7 @@ class SingleStatCtrl extends MetricsPanelCtrl {
function addSparkline() {
const data: ShowData = ctrl.data;
const width = elem.width();
if (width < 30) {
if (width && width < 30) {
// element has not gotten it's width yet
// delay sparkline render
setTimeout(addSparkline, 30);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment