global map

One Star

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???
One Star

Re: global map

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
One Star

Re: global map

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
One Star

Re: global map

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"))
One Star

Re: global map

Thanks. It worked.
One Star

Re: global map

You're welcome :-)

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch

Downloads and Trials

Test drive Talend's enterprise products.

Downloads