Dfx fixbug

remove line end of space
fixed null pointer bug, optimized code.