Tue, 26 Sep 2006 17:38:09 +0000
[gaim-migrate @ 17356]
After the comments on gaim-devel about 'bad' code, I looked into the function referenced. It appears that yahoo_buddy_icon_upload_connected() is only called as a callback. It's registered from yahoo_buddy_icon_upload(). yahoo_buddy_icon_upload() is only called twice. In neither case can a NULL make it down to yahoo_buddy_icon_upload_connected(). As this is an exceptional case rather than a normal one, a g_return_if_fail() is more appropriate. That adds logging, makes the intent clearer, and will help the Coverity software detect violations of this assumption.
| 2086 | 1 | /* |
| 2 | ||
| 3 | Copyright 1987,1988 by the Massachusetts Institute of Technology | |
| 4 | ||
| 5 | All rights reserved. | |
| 6 | ||
| 7 | Permission to use, copy, modify, and distribute this software and its | |
| 8 | documentation for any purpose and without fee is hereby granted, | |
| 9 | provided that the above copyright notice appear in all copies and that | |
| 10 | both that copyright notice and this permission notice appear in | |
| 11 | supporting documentation, and that the name of the Massachusetts | |
| 12 | Institute of Technology (M.I.T.) not be used in advertising or publicity | |
| 13 | pertaining to distribution of the software without specific, written | |
| 14 | prior permission. | |
| 15 | ||
| 16 | M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING | |
| 17 | ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL | |
| 18 | M.I.T. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR | |
| 19 | ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, | |
| 20 | WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, | |
| 21 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS | |
| 22 | SOFTWARE. | |
| 23 | ||
| 24 | */ |