Skip to content

Commit

Permalink
fix(jmx): operations tab crashes when mbean has no operations
Browse files Browse the repository at this point in the history
  • Loading branch information
tadayosi committed Jun 29, 2023
1 parent caa09f7 commit 73dcc3f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/hawtio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"@types/react-router-dom": "^5.3.3",
"dagre": "^0.8.5",
"eventemitter3": "^5.0.1",
"jolokia.js": "1.7.2",
"jolokia.js": "1.7.3-1",
"jquery": "^3.7.0",
"js-logger": "^1.6.1",
"keycloak-js": "^21.1.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/hawtio/src/plugins/camel/camel-content-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export function canBrowse(node: MBeanNode): boolean {
}

export function canBrowseMessages(node: MBeanNode): boolean {
const browseMessages = node.mbean?.op['browseMessageAsXml']
const browseMessages = node.mbean?.op?.['browseMessageAsXml']
return !!browseMessages
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const AttributeModal: React.FunctionComponent<AttributeModalProps> = prop
return null
}

const attribute = selectedNode.mbean.attr[name]
const attribute = selectedNode.mbean.attr?.[name]
if (!attribute) {
return null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const Operations: React.FunctionComponent = () => {
const objectName = selectedNode.objectName
const mbean = selectedNode.mbean

if (isEmpty(mbean.op)) {
if (!mbean.op || isEmpty(mbean.op)) {
return (
<Card>
<CardBody>
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2029,7 +2029,7 @@ __metadata:
jest-environment-jsdom: ^29.5.0
jest-fetch-mock: ^3.0.3
jest-watch-typeahead: ^2.2.2
jolokia.js: 1.7.2
jolokia.js: 1.7.3-1
jquery: ^3.7.0
js-logger: ^1.6.1
keycloak-js: ^21.1.2
Expand Down Expand Up @@ -11115,12 +11115,12 @@ __metadata:
languageName: node
linkType: hard

"jolokia.js@npm:1.7.2":
version: 1.7.2
resolution: "jolokia.js@npm:1.7.2"
"jolokia.js@npm:1.7.3-1":
version: 1.7.3-1
resolution: "jolokia.js@npm:1.7.3-1"
dependencies:
"@types/jquery": ^3.5.14
checksum: 88aafeee1416ee6b02c0d7fd78bc8bf379a928f0047a7cb629c2eff5ddc9403a57b59ebbf58e86a55984649de76a18a93fc7153d7763d916981624f5034477af
checksum: 9bc6f6a5d42f8e3105c33fa00da09fbea3252251dec31d263d41876dbdd101da9581508b9c5517b934749958470eb6822fe75ab3a36474d452438417453b513c
languageName: node
linkType: hard

Expand Down

0 comments on commit 73dcc3f

Please sign in to comment.