Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Bugfix for exception on the logs page (#1641)

Dominique Kleeven62386b0a8c5f
diff --git a/ui/component/or-log-viewer/src/index.ts b/ui/component/or-log-viewer/src/index.ts
index bba92749f..2d0a7e587 100644
--- a/ui/component/or-log-viewer/src/index.ts
+++ b/ui/component/or-log-viewer/src/index.ts
@@ -475,9 +475,9 @@ export class OrLogViewer extends translate(i18next)(LitElement) {
this._loading = false;
if (response.status === 200) {
- // Get page count
- this._pageCount = this._getPageCount(response);
this._data = response.data;
+ // Get page count
+ this._pageCount = this._getPageCount(response);
}
}
@@ -486,7 +486,7 @@ export class OrLogViewer extends translate(i18next)(LitElement) {
if (linkHeaders) {
const links = linkParser.parse(linkHeaders);
const lastLink = links.rel("last");
- if (lastLink) {
+ if (lastLink && lastLink.uri) {
const url = new URL(lastLink.uri);
return Util.getQueryParameters(url.search)['page'] as number;
}