fastcgipp-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fastcgipp-users] form handler crashing if posts key missing


From: ninti
Subject: [Fastcgipp-users] form handler crashing if posts key missing
Date: Tue, 05 Jan 2010 15:20:20 +1030

I am having issues with a form handling program crashing whenever an expected 
environment.posts[ ] key is not present. 
 
I can test for the existence of the key using environment.postVariableExists(), 
but all attempts to handle this so far have not worked and the program still 
crashes.  
 
For example: 
 
std::string input_name; 
if (environment.postVariableExists("name")) {  
    input_name = environment.posts["name"].value;  
} 
else { 
    input_name = "empty"; 
} 
 
// now do something with input_name; 
 
 
Program works fine if key is present, but crashes if not.  
I would expect that the contents of the 'if' block would only be examined if 
the key existed, but it appears that maybe that isn't the case. 
 
Any suggestions on how to handle missing POST data gratefully accepted. 
 
I am using Nginx + FastCGI is that is relevant. 
 
Thanks 
Mike 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]