Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add extra check for GPU device info for null pointer #3032

Merged
merged 4 commits into from
Nov 6, 2023
Merged

Add extra check for GPU device info for null pointer #3032

merged 4 commits into from
Nov 6, 2023

Conversation

PylotLight
Copy link
Contributor

@PylotLight PylotLight commented Nov 5, 2023

Description

When running doctor, the github.com/jaypipes/ghw package currently is used to run a GPU check for device info but in the edge case where the user doesn't have drivers installed, the package causes a null pointer error which is not handled properly.
I added an extra check in case the user doesn't have drivers installed to return the correct information which results in "unknown" for bad installation and normal results if everything is correct.

Fixes # (issue)

I haven't submitted an issue for this one yet sorry as this is likely only impacting me currently as I was messing with my WSL install but though I should submit PR to handle this edge case anway, do I need to submit one?

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration using wails doctor.

  • Windows
  • macOS
  • Linux
    Results from my WSL install:
light@pc:~/repos/wailsfork$ wails3 doctor
Wails Doctor          

# Build Environment
Wails CLI    | v3.0.0-alpha.0                          
Go Version   | go1.21.3                                
Revision     | f49d42678bd7deb24de1f66e08c15eeace080d32
Modified     | true                                    
-buildmode   | exe                                     
-compiler    | gc                                      
CGO_CFLAGS   |                                         
CGO_CPPFLAGS |                                         
CGO_CXXFLAGS |                                         
CGO_ENABLED  | 1                                       
CGO_LDFLAGS  |                                         
GOAMD64      | v1                                      
GOARCH       | amd64                                   
GOOS         | linux                                   
vcs          | git                                     
vcs.modified | true                                    
vcs.revision | f49d42678bd7deb24de1f66e08c15eeace080d32
vcs.time     | 2023-11-03T04:41:17Z                    

# System
Name         | Debian GNU/Linux                        
Version      | 12                                      
ID           | debian                                  
Branding     | 12 (bookworm)                           
Platform     | linux                                   
Architecture | amd64                                   
gcc          | 12.9                                    
libgtk-3     | 3.24.38-2~deb12u1                       
libwebkit    | 2.42.1-1~deb12u1                        
npm          | 9.2.0~ds1-1                             
pkg-config   | 1.8.1-1                                 
CPU          | Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
GPU          | Unknown                                 
Memory       | 16GB

Test Configuration

N/A

Checklist:

  • I have updated website/src/pages/changelog.mdx with details of this PR
  • My code follows the general coding style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Copy link

netlify bot commented Nov 5, 2023

Deploy Preview for dapper-pastelito-9b5e5b failed.

Name Link
🔨 Latest commit 90820cd
🔍 Latest deploy log https://app.netlify.com/sites/dapper-pastelito-9b5e5b/deploys/6548b6e1c3c29400085b8509

@leaanthony leaanthony merged commit 7c15f90 into wailsapp:v3-alpha Nov 6, 2023
3 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants