Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-29080

[release-4.15] Modal dialogs expose code that is not null object safe

XMLWordPrintable

    • Moderate
    • No
    • False
    • Hide

      None

      Show
      None

      This is a clone of issue OCPBUGS-28856. The following is the description of the original issue:

      Description of problem:

      When using the modal dialogs in a hook as part of the actions hook (i.e. useApplicationsActionsProvider) the console will throw an error since the console framework will pass null objects as part of the render cycle. According to Jon Jackson, the console should be safe from null objects but it looks like the code for useDeleteModal and getGroupVersionKindForresource are not safe,

      Version-Release number of selected component (if applicable):

          

      How reproducible:

         Always 

      Steps to Reproduce:

          1. Use one of the modal APIs in an actions provider hook
          2.
          3.
          

      Actual results:

          Caught error in a child component: TypeError: Cannot read properties of undefined (reading 'split')
          at i (main-chunk-9fbeef79a…d3a097ed.min.js:1:1)
          at u (main-chunk-9fbeef79a…d3a097ed.min.js:1:1)
          at useApplicationActionsProvider (useApplicationActionsProvider.tsx:23:43)
          at ApplicationNavPage (ApplicationDetails.tsx:38:67)
          at na (vendors~main-chunk-8…87b.min.js:174297:1)
          at Hs (vendors~main-chunk-8…87b.min.js:174297:1)
          at Sc (vendors~main-chunk-8…87b.min.js:174297:1)
          at Cc (vendors~main-chunk-8…87b.min.js:174297:1)
          at _c (vendors~main-chunk-8…87b.min.js:174297:1)
          at pc (vendors~main-chunk-8…87b.min.js:174297:1) 

      Expected results:

          Works with no error

      Additional info:

          

            rhn-engineering-rhamilto Robb Hamilton
            openshift-crt-jira-prow OpenShift Prow Bot
            YaDan Pei YaDan Pei
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: