a potential NPE in DmgServer.java
See original GitHub issueDescribe the bug
-
In
DmgFileReader.java
(GPL/DMG/src/dmg/java/mobiledevices/dmg/reader/DmgFileReader.java), line 256 functiongetInfo
returns null whenpath
is null. -
In
DmgServer.java
(GPL/DMG/src/dmg/java/mobiledevices/dmg/server/DmgServer.java) line 106List<String> infoList = dmgFileReader.getInfo(path);
will assigninfoList
null. -
The expression
infoList.size()
in line 107 will NPE.
To Reproduce See above
Expected behavior N/A
Screenshots N/A
Attachments N/A
Environment (please complete the following information): N/A
Additional context N/A
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Why do I still receive warning for possible NPE in IntelliJ when ...
To my big surprise, I'm still getting: Method invocation ' Service.getConnectionManager().onAssetInfoChanged() ' at line 308 may produce ' java.
Read more >How to Fix and Avoid NullPointerException in Java - Rollbar
NullPointerException in Java occurs when a variable is accessed which is not pointing to any object and refers to nothing or null.
Read more >NullPointerException in Java: Causes and Ways to Avoid It
NullPointerException (NPE) is the most common exception in Java. The cause of this exception is ... Potentially, both of them might be null....
Read more >Java NullPointerException - Detect, Fix, and Best Practices
NullPointerException is a runtime exception, so we don't need to catch it in the program. NullPointerException is raised in an application when ...
Read more >How to deal with NullPointerException in Java with Examples
NullPointerException has outlined scenario when it could occur: 1) When you call the instance method on a null object. you won't get a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
As you say, you’re running static analysis and hoping others will validate your ‘findings’. Where is the stack trace, whats the user interaction that causes this, what is the input to cause this, do you have binary to load or a script or maybe a java test class, anything?
Whatever I have does not prevent you from answering the question so here I go again. If the person is so confident
path
can not be null why not simply doI’d be very happy to hear your lecture on why that is the case or anything else you have to say. By the way feel free to close the issue as I don’t give a damn how great this codebase is written.