Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Note: You may notice some temporary visual or styling issues in the Community. Our vendor is actively investigating.
cancel
Showing results for 
Search instead for 
Did you mean: 
veryimportantdude
Contributor III
Contributor III

global map

It seems that when I call global map in tMap with ((Integer)globalMap.get("sipr")) it returns null pointer exception.
I insert variable into global Map from tJavaRow with globalMap.put("sipr",sipr); type is integer
any suggestions???
Labels (3)
5 Replies
Anonymous
Not applicable

Hi,
That most likely means that the put has not been executed before the get, or the put has put a null sipr. You can verify this with the debugger.
Daniel
veryimportantdude
Contributor III
Contributor III
Author

It probalby puts NULL. What do I do?
I am not a java programer so any hint to write a code would be nice.
Thank you
Anonymous
Not applicable

Hi Guys,
Yup, it returns null and you must handle the null value properly. You could put a condition like this :
((Integer)globalMap.get("sipr")) == null ? 0: ((Integer)globalMap.get("sipr"))
veryimportantdude
Contributor III
Contributor III
Author

Thanks. It worked.
Anonymous
Not applicable

You're welcome 🙂